Swizzle Barrier Optimizations for Orthogonal Persistence in Java

Swizzling refers to the translation of object references from an external, persistent format to an internal, transient format used during application execution. Eager swizzling schemes translate all the references contained by objects as they are made resident. Lazy swizzling schemes defer translation of references until they are loaded from their container. Eager swizzling has the advantage of presenting a uniformly swizzled representation of references to the execution engine, at the cost of up-front translation of references that may never be used. Lazy swizzling avoids this cost, but requires a run-time check that we call a swizzle barrier to detect and convert unswizzled references as they are accessed. Lazy swizzling is most often used in situations where accesses are likely to be sparse and the up-front cost of eager swizzling is prohibitive. For example, large containers, such as arrays, may contain many thousands of references, only a fraction of which are ever actually accessed, let alone used to access their target. Thus, lazy swizzling of arrays makes sense even while other types of objects are eagerly swizzled, in which case every array access must be protected by a swizzle barrier. Many, if not most, of these barriers will occur in the bodies of loops that iterate through the elements of arrays. Here, we describe how to hoist loop-nested swizzle barriers into one inclusive barrier operation that can be performed outside the loop, and which swizzles the subset of array elements accessed in the loop body. Our approach to array swizzle barrier optimization is based on loop induction variable analysis. We have implemented this approach for the PJama prototype of orthogonal persistence for Java. In experiments with several benchmark applications our optimizations reduce the number of swizzle barriers executed by an average of 66%.

[1]  Keith D. Cooper,et al.  Value Numbering , 1997, Softw. Pract. Exp..

[2]  J. Eliot B. Moss,et al.  Working with Persistent Objects: To Swizzle or Not to Swizzle , 1992, IEEE Trans. Software Eng..

[3]  James R. Larus,et al.  Detecting conflicts between structure accesses , 1988, PLDI '88.

[4]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[5]  Michael Wolfe,et al.  Beyond induction variables: detecting and classifying sequences using a demand-driven SSA form , 1995, TOPL.

[6]  Quintin I. Cutts,et al.  Reconciling Buffer Management with Persistence Optimisations , 1998, POS/PJW.

[7]  Quintin Cutts,et al.  Analysing, Profiling and Optimising Orthogonal Persistence for Java , 1997 .

[8]  Keith D. Cooper,et al.  Value Numbering , 1997, Softw. Pract. Exp..

[9]  Quintin I. Cutts,et al.  Optimizing the Read and Write Barriers for Orthogonal Persistence , 1998, POS/PJW.

[10]  Michael Wolfe,et al.  High performance compilers for parallel computing , 1995 .

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

[12]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[13]  Nathaniel John Nystrom,et al.  BYTECODE-LEVELANALYSIS AND OPTIMIZATION OF JAVA CLASSES , 1998 .

[14]  Keith D. Cooper,et al.  Practical improvements to the construction and destruction of static single assignment form , 1998, Softw. Pract. Exp..

[15]  Etienne Morel,et al.  Global optimization by suppression of partial redundancies , 1979, CACM.

[16]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[17]  Amer Diwan,et al.  Type-based alias analysis , 1998, PLDI.

[18]  Kumar Brahnmath,et al.  Optimizing orthogonal persistence for java , 1998 .

[19]  Raymond Lo,et al.  A new algorithm for partial redundancy elimination based on SSA form , 1997, PLDI '97.

[20]  Jens Palsberg,et al.  Object-oriented type systems , 1994, Wiley professional computing.

[21]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[22]  Robert E. Tarjan,et al.  Depth-First Search and Linear Graph Algorithms , 1972, SIAM J. Comput..

[23]  Malcolm P. Atkinson,et al.  An orthogonally persistent Java , 1996, SGMD.

[24]  Michael Wolfe,et al.  Extended SSA with factored use-def chains to support optimization and parallelism , 1994, 1994 Proceedings of the Twenty-Seventh Hawaii International Conference on System Sciences.

[25]  Timothy J. Harvey,et al.  Practical improvements to the construction and destruction of static single assignment form , 1998 .