Detecting Read-Only Methods in Java

One typically defines a read-only method as a method that does not perform any write operations; however, with respect to a multithreaded program, we augment this interpretation and let a read-only method be one that does not write to a memory location visible to more than one thread. Such a method can execute concurrently with other read-only methods. With the relaxation of mutual exclusion in mind, we present a read-write analysis that employs the ideas of shape analysis and escape analysis to identify readonly methods in Java. Approximately 31% of the methods in the JDK 1.2 core libraries meets this definition of read-only--nearly 50% more than those that do not perform any write operations.

[1]  Bruno Blanchet,et al.  Escape analysis for object-oriented languages: application to Java , 1999, OOPSLA '99.

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

[3]  Reinhard Wilhelm,et al.  Shape Analysis , 2000, CC.

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

[5]  Emin Gün Sirer,et al.  Static Analyses for Eliminating Unnecessary Synchronization from Java Programs , 1999, SAS.

[6]  Martin C. Rinard,et al.  Commutativity analysis: a new analysis technique for parallelizing compilers , 1997, TOPL.

[7]  Vijay Karamcheti,et al.  Object views: language support for intelligent object caching in parallel and distributed computations , 1999, OOPSLA '99.

[8]  Jong-Deok Choi,et al.  Escape analysis for Java , 1999, OOPSLA '99.

[9]  Laurie J. Hendren,et al.  Is it a tree, a DAG, or a cyclic graph? A shape analysis for heap-directed pointers in C , 1996, POPL '96.

[10]  BlanchetBruno Escape analysis for object-oriented languages , 1999 .

[11]  Reinhard Wilhelm,et al.  Solving shape-analysis problems in languages with destructive updating , 1998, TOPL.

[12]  Martin C. Rinard,et al.  Compositional pointer and escape analysis for Java programs , 1999, OOPSLA '99.

[13]  Urs Hölzle,et al.  Removing unnecessary synchronization in Java , 1999, OOPSLA '99.

[14]  James C. Corbett,et al.  Using shape analysis to reduce finite-state models of concurrent Java programs , 2000, TSEM.

[15]  Kazuo Taki,et al.  Eliminating bottlenecks on parallel systems using adaptive objects , 1998, Proceedings. 1998 International Conference on Parallel Architectures and Compilation Techniques (Cat. No.98EX192).