Repository logo
Log in(current)
Repository logoMIT Open ScholarshipDSpace@MIT
  1. Home
  2. Computer Science and Artificial Intelligence Lab (CSAIL)
  3. CSAIL Digital Archive
  4. CSAIL Technical Reports (July 1, 2003 - present)
  5. A Combined Pointer and Purity Analysis for Java Programs

A Combined Pointer and Purity Analysis for Java Programs

Thumbnail Image
Download
Name

MIT-CSAIL-TR-2004-030.ps

Size

27.55 MB

Format

PostScript

Checksum (MD5)

86c2f464111a7edad8afe882ad40f9fc

Thumbnail Image
Download
Name

MIT-CSAIL-TR-2004-030.pdf

Size

1.15 MB

Format

Adobe PDF

Checksum (MD5)

6fad154bd41b4096d19a81462bb1e681

Author(s)
Salcianu, Alexandru
•
Rinard, Martin
Date Issued
May 17, 2004
Series/Report no.
Massachusetts Institute of Technology Computer Science and Artificial Intelligence Laboratory
Abstract
We present a new method purity analysis for Java programs.A method is pure if it does not mutate any location that exists in the program state right before method invocation.Our analysis is built on top of a combined pointer and escape analysis for Java programs and is capable of determining that methods are pure even when the methods do heap mutation, provided that the mutation affects only objects created after the beginning of the method. Because our analysis extracts a precise representation of the region of the heap that each method may access, it is able to provide useful information even for methods with externally visible side effects. In particular, it can recognize read-only parameters (a parameter is read-only if the method does not mutate any objects transitively reachable from the parameter) and safe parameters (a parameter is safe if it is read-only and the method does not create any new externally visible paths in the heap to objects transitively reachable from the parameter). The analysis can also generate regular expressions that characterize the externally visible heap locations that the method mutates.We have implemented our analysis and used it to analyze several data structure implementations. Our results show that our analysis effectively recognize a variety of pure methods, including pure methods that allocate and mutate complex auxiliary data structures. Even if the methods are not pure, our analysis can provide information which may enable developers to usefully bound the potential side effects of the method.
Persistent DSpace Link
http://hdl.handle.net/1721.1/30470
Repository logo
PrivacyPermissionsAccessibilityContact us
Repository logo
Notify us about copyright concerns.