Skip to main content

Class-Modular, Class-Escape and Points-to Analysis for Object-Oriented Languages

  • Conference paper
NASA Formal Methods (NFM 2012)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7226))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Andersen, L.: Program analysis and specialization for the C programming language. Tech. rep., 94-19, University of Copenhagen (1994)

    Google Scholar 

  2. Blanchet, B.: Escape analysis for object-oriented languages: application to Java. SIGPLAN Not. 34, 20–34 (1999)

    Article  Google Scholar 

  3. Boyapati, C., Liskov, B., Shrira, L.: Ownership types for object encapsulation. SIGPLAN Not. 38, 213–223 (2003)

    Article  Google Scholar 

  4. Cheng, B.C., Hwu, W.M.W.: Modular interprocedural pointer analysis using access paths: design, implementation, and evaluation. In: Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation, PLDI 2000, pp. 57–69. ACM, New York (2000)

    Chapter  Google Scholar 

  5. Cousot, P., Cousot, R.: Modular Static Program Analysis. In: Horspool, R.N. (ed.) CC 2002. LNCS, vol. 2304, pp. 159–179. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  6. Dolby, J., Chien, A.: An automatic object inlining optimization and its evaluation. SIGPLAN Not 35(5), 345–357 (2000), aCM ID: 349344

    Article  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 

  10. Logozzo, F.: Automatic Inference of Class Invariants. In: Steffen, B., Levi, G. (eds.) VMCAI 2004. LNCS, vol. 2937, pp. 211–222. Springer, Heidelberg (2004)

    Chapter  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 

  13. Rountev, A.: Component-Level Dataflow Analysis. In: Heineman, G.T., Crnković, I., Schmidt, H.W., Stafford, J.A., Ren, X.-M., Wallnau, K. (eds.) CBSE 2005. LNCS, vol. 3489, pp. 82–89. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  14. Rountev, A., Ryder, B.G.: Points-to and Side-Effect Analyses for Programs Built with Precompiled Libraries. In: Wilhelm, R. (ed.) CC 2001. LNCS, vol. 2027, pp. 20–36. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  15. Seidl, H., Vene, V., Müller-Olm, M.: Global invariants for analyzing multithreaded applications. Proc. of the Estonian Academy of Sciences: Phys., Math. 52(4), 413–436 (2003)

    MATH  Google Scholar 

  16. Seidl, H., Vojdani, V.: Region Analysis for Race Detection. In: Palsberg, J., Su, Z. (eds.) SAS 2009. LNCS, vol. 5673, pp. 171–187. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  17. Steensgaard, B.: Points-to analysis in almost linear time. In: Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1996, pp. 32–41. ACM, New York (1996)

    Chapter  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 

  20. Vojdani, V., Vene, V.: Goblint: Path-sensitive data race analysis. Annales Univ. Sci. Budapest., Sect. Comp. 30, 141–155 (2009)

    MATH  Google Scholar 

  21. Whaley, J., Rinard, M.: Compositional pointer and escape analysis for Java programs. In: Proceedings of the 14th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 1999, pp. 187–206. ACM, New York (1999)

    Chapter  Google Scholar 

  22. Wimmer, C., Mössenböck, H.: Automatic feedback-directed object inlining in the java hotspot(tm) virtual machine. In: Proceedings of the 3rd International Conference on Virtual Execution Environments, VEE 2007, pp. 12–21. ACM, New York (2007)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Herz, A., Apinis, K. (2012). Class-Modular, Class-Escape and Points-to Analysis for Object-Oriented Languages. In: Goodloe, A.E., Person, S. (eds) NASA Formal Methods. NFM 2012. Lecture Notes in Computer Science, vol 7226. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-28891-3_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-28891-3_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-28890-6

  • Online ISBN: 978-3-642-28891-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics