Automatic array inlining in java virtual machines

Array inlining expands the concepts of object inlining to arrays. Groups of objects and arrays that reference each other are placed consecutively in memory so that their relative offsets are fixed, i.e. they are colocated. This allows memory loads to be replaced by address arithmetic, which reduces the costs of field and array accesses. We implemented this optimization for Sun Microsystems' Java HotSpot VM. The optimization is performed automatically and requires no actions on the part of the programmer. Arrays are frequently used for the implementation of dynamic data structures. Therefore, the length of arrays often varies, and fields referencing such arrays have to be changed whenever the array is reallocated. We present an efficient code pattern that detects these changes and allows the optimized access of such array fields. It is integrated into the array bounds check. We also claim that inlining array element objects into an array is not possible without a global data flow analysis. The evaluation shows that our dynamic approach can optimize frequently accessed fields with a reasonable low compilation and analysis overhead. The peak performance of SPECjvm98 is improved by 10% on average, with a maximum of 25%.

[1]  David A. Padua,et al.  Instance-wise points-to analysis for loop-based dependence testing , 2002, ICS '02.

[2]  Robert Griesemer,et al.  A Compiler for the Java HotSpotTM Virtual Machine , 2000, The School of Niklaus Wirth.

[3]  Craig Chambers,et al.  Debugging optimized code with dynamic deoptimization , 1992, PLDI '92.

[4]  Ecma,et al.  Common Language Infrastructure (CLI) , 2001 .

[5]  James R. Larus,et al.  Using generational garbage collection to implement cache-conscious data placement , 1998, ISMM '98.

[6]  Henri E. Bal,et al.  Object combining: A new aggressive optimization for object intensive programs , 2002, JGI '02.

[7]  Niklaus Wirth The School of Niklaus Wirth, "The Art of Simplicity" , 2000 .

[8]  Keith H. Randall,et al.  Field analysis: getting useful and low-cost interprocedural information , 2000, PLDI '00.

[9]  Ondrej Lhoták,et al.  Run-time evaluation of opportunities for object inlining in Java , 2002, JGI '02.

[10]  Andrew A. Chien,et al.  An evaluation of automatic object inline allocation techniques , 1998, OOPSLA '98.

[11]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[12]  Rafael Dueire Lins,et al.  Garbage collection: algorithms for automatic dynamic memory management , 1996 .

[13]  Hanspeter Mössenböck,et al.  Design of the Java HotSpot#8482; client compiler for Java 6 , 2008, TACO.

[14]  Hanspeter Mössenböck,et al.  Automatic feedback-directed object inlining in the java hotspot™ virtual machine , 2007, VEE '07.

[15]  Andrew W. Appel,et al.  Creating and preserving locality of java applications at allocation and garbage collection times , 2002, OOPSLA '02.

[16]  Hanspeter Mössenböck,et al.  Array bounds check elimination for the Java HotSpot#8482; client compiler , 2007, PPPJ.

[17]  Julian Dolby Automatic inline allocation of objects , 1997, PLDI '97.

[18]  Laurie J. Hendren,et al.  A Comprehensive Approach to Array Bounds Check Elimination for Java , 2002, CC.

[19]  Andrew A. Chien,et al.  An automatic object inlining optimization and its evaluation , 2000, PLDI '00.

[20]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[21]  WimmerChristian,et al.  Design of the Java HotSpot client compiler for Java 6 , 2008 .

[22]  Michael Hind,et al.  Pointer analysis: haven't we solved this problem yet? , 2001, PASTE '01.

[23]  Hanspeter Mössenböck,et al.  Automatic Object Colocation Based on Read Barriers , 2006, JMLC.

[24]  Perry Cheng,et al.  The garbage collection advantage: improving program locality , 2004, OOPSLA.

[25]  Vivek Sarkar,et al.  ABCD: eliminating array bounds checks on demand , 2000, PLDI '00.