Detecting Read-Only Methods in Java

  • Authors:
  • Jeff Bogda

  • Affiliations:
  • -

  • Venue:
  • LCR '00 Selected Papers from the 5th International Workshop on Languages, Compilers, and Run-Time Systems for Scalable Computers
  • Year:
  • 2000

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.