Immutability specification and its applications

A location is said to be immutable if its value and thevalues of selected locations reachable from it are guaranteed toremain unchanged during a specified time interval. We introduce aframework for immutability specification, and discuss itsapplication to code optimization. Compared to a finaldeclaration, an immutability assertion in our framework can expressa richer set of immutability properties along three dimensions ---lifetime, reachability and context. We present a framework for processing and verifying immutabilityannotations in Java, as well as extending optimizations so as toexploit immutability information. Preliminary experimental resultsshow that a significant number (82%) of read accesses couldpotentially be classified as immutable in our framework. Further,use of immutability information yields substantial reductions (33%to 99%) in the number of dynamic read accesses, and also measurablespeedups in the range of 5% to 10% for certain benchmarkprograms.

[1]  Alexandru Nicolau,et al.  Java annotation-aware just-in-time (AJIT) complilation system , 1999, JAVA '99.

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

[3]  Laurie J. Hendren,et al.  A framework for optimizing Java using attributes , 2000, CASCON.

[4]  William Pugh Fixing the Java memory model , 1999, JAVA '99.

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

[6]  Bowen Alpern,et al.  Detecting equality of variables in programs , 1988, POPL '88.

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

[8]  Samuel N. Kamin,et al.  Annotating Java class files with virtual registers for performance , 2000, Concurr. Pract. Exp..

[9]  Bjarne Stroustrup,et al.  The Annotated C++ Reference Manual , 1990 .

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

[11]  Vivek Sarkar,et al.  Dependence Analysis for Java , 1999, LCPC.

[12]  Markus Mock,et al.  A retrospective on: "an evaluation of staged run-time optimizations in DyC" , 2004, SIGP.

[13]  Bilha Mendelson,et al.  Automatic detection of immutable fields in Java , 2000, CASCON.

[14]  Vivek Sarkar,et al.  Dynamic optimistic interprocedural analysis: a framework and an application , 2001, OOPSLA '01.

[15]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

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

[17]  Vivek Sarkar,et al.  Unified Analysis of Array and Object References in Strongly Typed Languages , 2000, SAS.

[18]  Stephen J. Fink,et al.  The Jalapeño virtual machine , 2000, IBM Syst. J..

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

[20]  James R. Larus,et al.  Cache-conscious structure layout , 1999, PLDI '99.

[21]  M. Wegman,et al.  Global value numbers and redundant computations , 1988, POPL '88.