Class-Modular, class-escape and points-to analysis for object-oriented languages

  • Authors:
  • Alexander Herz;Kalmer Apinis

  • Affiliations:
  • Lehrstuhl für Informatik II, Technische Universität München, Garching b. München, Germany;Lehrstuhl für Informatik II, Technische Universität München, Garching b. München, Germany

  • Venue:
  • NFM'12 Proceedings of the 4th international conference on NASA Formal Methods
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

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 [6] more efficiently or enable the automatic inference of class invariants [10]. 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.