Dr. Christian Wimmer

Automatic Object Inlining in a Java Virtual Machine

Christian Wimmer: Automatic Object Inlining in a Java Virtual Machine. Schriftenreihe der Johannes Kepler Universität Linz, Reihe C, Band 57. Trauner Verlag, 2008. ISBN: 978-3-85499-417-6

Buy online from Trauner Verlag or from Amazon.


Java applications are compiled to platform-independent bytecodes and executed using a virtual machine. Inside the VM, the just-in-time compiler translates frequently executed methods to optimized machine code, and the garbage collector reclaims unreferenced objects automatically. Both impose a run-time overhead, but they can be used to implement novel feedback-directed optimizations inside the VM that are not possible in a static compiler.

Following the object-oriented design principle, Java applications allocate many small objects linked together by field references. Object inlining reduces the costs of field accesses by combining referenced objects with their referencing object. The order of objects on the heap is changed by the garbage collector so that they are placed next to each other. Then their offset is fixed, i.e. the objects are colocated. This allows field loads to be replaced by address arithmetic using the just-in-time compiler. Array inlining expands the concepts of object inlining to arrays, which are frequently used for the implementation of dynamic data structures.

This book presents a novel feedback-directed approach for object and array inlining that is performed automatically at run time, requires no actions on the part of the programmer, and supports dynamic class loading. The book describes the algorithms, illustrates them with several examples, and evaluates them using a set of typical benchmarks.