Abstract
One typically defines a read-only method as a method that does not perform any write operations; however, with respect to a multi-threaded 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 read- only 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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Jonathan Aldrich, Craig Chambers, Emin Gun Sirer, and Susan Eggers. Static Analyses for Eliminating Unnecessary Synchronization from Java Programs. In Proceedings of the Sixth International Static Analysis Symposium (SAS ’99), Venezia, Italy, September 1999.
Bruno Blanchet. Escape Analysis for Object-Oriented Languages. Application to Java. In Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA ’99), pages 20–34, Denver, Colorado, 1-5 November 1999.
Jeff Bogda and Urs Hölzle. Removing Unnecessary Synchronization in Java. In Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA ’99), pages 35–46, Denver, Colorado, 1-5 November 1999.
J.-D. Choi, M. Gupta, M. Serrano, V. C. Sreedhar, and S. Midkiff. Escape Analysis for Java. In Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA ’99), pages 1–19, Denver, Colorado, 1-5 November 1999.
James C. Corbett. Using Shape Analysis to Reduce Finite-State Models of Concurrent Java Programs. Technical Report ICS-TR-98-20, Department of Information and Computer Science, University of Hawaii, 14 October 1998.
Rakesh Ghiya and Laurie J. Hendren. Is it a Tree, a DAG, or a Cyclic Graph? A Shape Analysis for Heap-Directed Pointers in C. In Conference Record of the 23rd ACM SIGPLANSIGACT Symposium on Principles of Programming Languages (POPL ’96), pages 1–15, St. Petersburg Beach, Florida, 21-24 January 1996.
James Gosling, Bill Joy, and Guy Steele. The Java Language Specification. Addison-Wesley: Berkeley, California, 1996.
Ilya Lipkind, Igor Pechtchanski, and Vijay Karamcheti. Object Views: Language Support for Intelligent Object Caching in Parallel and Distributed Computations.In Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA ’99), pages 447–460, Denver, Colorado, 1-5 November 1999.
Martin C. Rinard and Pedro C. Diniz. Commutativity Analysis: A New Analysis Technique for Parallelizing Compilers. ACM Transactions on Programming Languages and Systems, pages 942–991, Volume 19, Number 6, November 1997.
Mooly Sagiv, Thomas Reps, and Reinhard Wilhelm. Solving Shape-Analysis Problems in Languages with Destructive Updating. In Conference Record of the 23rd ACM Symposium on Principles of Programming Languages (POPL ’96), pages 16–31, St. Petersburg Beach, Florida, 21-24 January 1996.
Bjarne Stroustrup. The C ++ Programming Language, Third Edition. Addison-Wesley: Berkeley, California, 1997.
John Whaley and Martin Rinard. Compositional Pointer and Escape Analysis for Java Programs. In Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA ’99), pages 187–206, Denver, Colorado, 1-5 November 1999.
Reinhard Wilhelm, Mooly Sagiv, and Thomas Reps. Shape Analysis. In Proceedings of the Conference on Compiler Construction, Berlin, Germany, 27 March-2 April 2000.
Masahiro Yasugi, Shigeyuki Eguchi, and Kazuo Taki. Eliminating Bottlenecks on Parallel Systems using Adaptive Objects. In Proceedings of the International Conference on Parallel Architectures and Compilation Techniques (PACT ’98), pages 80–87, Paris, France, 12-18 October 1998.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bogda, J. (2000). Detecting Read-Only Methods in Java. In: Dwarkadas, S. (eds) Languages, Compilers, and Run-Time Systems for Scalable Computers. LCR 2000. Lecture Notes in Computer Science, vol 1915. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-40889-4_11
Download citation
DOI: https://doi.org/10.1007/3-540-40889-4_11
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-41185-7
Online ISBN: 978-3-540-40889-5
eBook Packages: Springer Book Archive