Class-Modular, Class-Escape and Points-to Analysis for Object-Oriented Languages
We present a combined class-modular points-to and class-escape analysis that allows to analyze class declarations even if no information about the code that invokes the class’s methods is available as is the case for e.g. shared libraries. Any standard whole-program or summary-based points-to analysis can be plugged into our framework and thus be transformed into a class-modular, class-escape and points-to analysis. The analysis framework uses the flow restrictions imposed by the access modifiers (e.g. private, public and protected in Java) to find all fields that may be modified by code that is not part of the class declaration. These fields escape the class. Unlike method-based summaries instantiated with an unknown context, our analysis framework can give detailed points-to information for non-escaping fields. In addition, the knowledge of which fields belong to the region that does not escape a class can be exploited to perform other analysis like class-modular object in-lining  more efficiently or enable the automatic inference of class invariants . We prove the soundness of the analysis and present a set of benchmarks showing that the analysis is suitable to analyze real world code and that more than 75% of the fields from the benchmarked classes are identified as non-escaping.
KeywordsAbstract Semantic Automatic Inference External Code Class Declaration Escape Analysis
Unable to display preview. Download preview PDF.
- 1.Andersen, L.: Program analysis and specialization for the C programming language. Tech. rep., 94-19, University of Copenhagen (1994)Google Scholar
- 7.Herz, A., Apinis, K.: Class-Modular, Class-Escape and Points-to Analysis (Proof). Tech. rep., TUM-I1202, Technische Universität München (2012)Google Scholar
- 8.Horwitz, S., Shapiro, M.: Modular Pointer Analysis. Tech. rep., 98-1378, University of Wisconsin–Madison (1998)Google Scholar
- 9.Lattner, C., Adve, V.: Llvm: a compilation framework for lifelong program analysis transformation. In: International Symposium on Code Generation and Optimization, CGO 2004, pp. 75–86 (2004)Google Scholar
- 11.Open Source 3D Graphics Engine OGRE, http://www.ogre3d.org/
- 12.Porat, S., Biberstein, M., Koved, L., Mendelson, B.: Automatic detection of immutable fields in Java. In: Proceedings of the 2000 Conference of the Centre for Advanced Studies on Collaborative Research, CASCON 2000, p. 10. IBM Press (2000)Google Scholar
- 18.Stroustrup, B.: The C++ programming language, vol. 3. Addison-Wesley, Reading (1997)Google Scholar
- 19.Sutter, H., Alexandrescu, A.: C++ coding standards: 101 rules, guidelines, and best practices. Addison-Wesley Professional (2005)Google Scholar