作者: Martin Rinard , Alexandru Salcianu
DOI:
关键词:
摘要: We present a new method purity analysis for Java programs. A is pure if it does not mutate any location that exists in the program state right before invocation. Our built on top of combined pointer and escape programs capable determining methods are even when do heap mutation, provided mutation affects only objects created after beginning method. Because our extracts precise representation region each may access, able to provide useful information with externally visible side effects. In particular, can recognize read-only parameters (a parameter transitively reachable from parameter) safe create paths parameter). The also generate regular expressions characterize locations mutates. have implemented used analyze several data structure implementations. results show effectively variety methods, including allocate complex auxiliary structures. Even pure, which enable developers usefully bound potential effects