10.1145/236337.236367acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedings
Article

Simple and effective analysis of statically-typed object-oriented programs

ABSTRACT

To use modern hardware effectively, compilers need extensive control-flow information. Unfortunately, the frequent method invocations in object-oriented languages obscure control flow. In this paper, we describe and evaluate a range of analysis techniques to convert method invocations into direct calls for statically-typed object-oriented languages and thus improve control-flow information in object-oriented languages. We present simple algorithms for type hierarchy analysis, aggregate analysis, and interprocedural and intraprocedural type propagation. These algorithms are also fast, O(|procedures| * ∑pprocedure np * vp) worst case time (linear in practice) for our slowest analysis, where np is the size of procedure p and vp is the number of variables in procedure p, and are thus practical for use in a compiler. When they fail, we introduce cause analysis to reveal the source of imprecision and suggest where more powerful algorithms may be warranted. We show that our simple analyses perform almost as well as an oracle that resolves all method invocations that invoke only a single procedure.

References

  1. 1.Ole Agesen and Urs H61zle. Type feedback vs. concrete type inference: A comparison of optimization techniques for object-oriented languages. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 91-107, Austin, Texas, October 1995. ACM. Google ScholarGoogle Scholar
  2. 2.Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley, 1986. Google ScholarGoogle Scholar
  3. 3.Gerald Aigner and Urs H01zle. Eliminating virtual filnction calls in C++ programs. In European conference on object-oriented programming, Linz, Austria, July 1996. Google ScholarGoogle Scholar
  4. 4.David Bacon and Peter Sweeney. Fast static analysis of C++ virtual function calls. In OOPSLA "96 Conference Proceedings: Object-Oriented Programming Systems, Languages, and Applications, San Jose, CA, October 1996. ACM, ACM Press. Google ScholarGoogle Scholar
  5. 5.Brad Calder and Dirk Grunwald. Reducing indirect function call overhead in C++ programs. In Conference Record of the Twenty-First A CM Symposium on Principles of Programming Languages, pages 397-408, Portland, Oregon, January 1994. Google ScholarGoogle Scholar
  6. 6.Craig Chambers. The design and evaluation of the SELF compiler, an optimizing compiler for object-oriented programming languages. PhD thesis, Stanford University, CA, March 1992. Google ScholarGoogle Scholar
  7. 7.Craig Chambers and David Ungar. Customization: Optimizing compiler technology for SELF, a dynamically-typed object-oriented programming language. In Proceedings of the A CM SIGPLAN "89 Conference on Programming Language Design and Implementation, pages 146-160, Portland, Oregon, June 1989. A CM SIGPLAN Notices 24, 7 (July 1989). Google ScholarGoogle Scholar
  8. 8.Craig Chambers and David Ungar. Iterative type analysis and extended message splitting: Optimizing dynamically-typed object-oriented programs. In Proceedings of the A CM SIGPLAN '90 Conference on Programming Language Design and Implementation, pages 150-164, White Plains, New York, June 1990.ACM SIGPLANNotices 25, 6 (June 1990). Google ScholarGoogle Scholar
  9. 9.Craig Chambers and David Ungar. Making pure object oriented languages practical. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 1-I 5, Phoenix, Arizona, October 1991. A CM SIGPLAN Notices 26, 11 (November 1991). Google ScholarGoogle Scholar
  10. 10.Jeffery Dean, David Grove, and Craig Chambers. Optimization of object-oriented programs using static class hierarchy analysis. In Proceedings of European Conference on Object-Oriented Programming, Aarhus, Denmark, August 1995. Google ScholarGoogle Scholar
  11. 11.Digital Equipment Corporation. DEC3000 300/400/500/600/800 Models: System Programmer's Manual, first printing edition, September 1993.Google ScholarGoogle Scholar
  12. 12.Mary E Fernandez. Simple and effective link-time optimization of Modula-3 programs. In Proceedings of Conference on Programming Language Design and Implementation, La Jolla, CA, June 1995. SIGPLAN, ACM Press. Google ScholarGoogle Scholar
  13. 13.David Grove, Jeffery Dean, Charles Garrett, and Craig Chambers. Profile-guided receiver class prediction. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, pa~ 108-123, Austin, Texas, October 1995. ACM. Google ScholarGoogle Scholar
  14. 14.Mary Wolcott Hall. Managing InterproceduralOptimizat PhD thesis, Rice University, Houston, Texas, April 1991.Google ScholarGoogle Scholar
  15. 15.Urs Htilzle and David Ungar. Optimizing dynamically-dispatched calls with run-time type feedbacl Proceedings of the A CM SIGPLAN '94 Conference on Programming Language Design and Implementation, pa~ 326-336. ACM, June 1994. Google ScholarGoogle Scholar
  16. 16.Bill Kalsow and Eric Muller. SRC Modula-3 Version 3.5. Systems Research Center, Digital Equipment Corporatior Palo Alto, CA, 1995.Google ScholarGoogle Scholar
  17. 17.J.B. Kam and J. D. Ullman. Global data flow analysis an iterative algorithms. Journal of the ACM, 7(3):305-318, 1 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 18.Farshad Nayeri, Benjamin Hurwitz, and Frank Manola. Generalizing dispatching in a distributed object system. I Proceedings of European Conference on Object-Orientea Programming, Bologna, Italy, July 1994. Google ScholarGoogle Scholar
  19. 19.Greg Nelson, editor. Systems Programming with ModuIa Prentice Hall, New Jersey, 1991. Google ScholarGoogle Scholar
  20. 20.Jens Palsberg and Michael I. Schwartzbach. Object-often type inference. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 146-162, Pheonix, Arizona, October 1991. SIGPLAN, ACM Press. Google ScholarGoogle Scholar
  21. 21.Hemant Pande and Barbara G Ryder. Static type determination and aliasing for C++. Technical Report LCSR-TR-250, Rutgers University, July 1995.Google ScholarGoogle Scholar
  22. 22.J. Plevyak and A. Chien. Precise concrete type inference object-oriented languages. In Proceedings of conference object-oriented programming systems, languages, and applications, pages 324-340. ACM, October 1994. Google ScholarGoogle Scholar
  23. 23.Olin Shivers. Control-flow analysis of higher-order languages. PhD thesis, Carnegie Mellon University, Pittsburgh, PA, May 1991. Google ScholarGoogle Scholar

Index Terms

  1. Simple and effective analysis of statically-typed object-oriented programs

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader
            About Cookies On This Site

            We use cookies to ensure that we give you the best experience on our website.

            Learn more

            Got it!