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.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 Scholar
- 2.Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley, 1986. Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 11.Digital Equipment Corporation. DEC3000 300/400/500/600/800 Models: System Programmer's Manual, first printing edition, September 1993.Google Scholar
- 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 Scholar
- 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 Scholar
- 14.Mary Wolcott Hall. Managing InterproceduralOptimizat PhD thesis, Rice University, Houston, Texas, April 1991.Google Scholar
- 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 Scholar
- 16.Bill Kalsow and Eric Muller. SRC Modula-3 Version 3.5. Systems Research Center, Digital Equipment Corporatior Palo Alto, CA, 1995.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- 19.Greg Nelson, editor. Systems Programming with ModuIa Prentice Hall, New Jersey, 1991. Google Scholar
- 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 Scholar
- 21.Hemant Pande and Barbara G Ryder. Static type determination and aliasing for C++. Technical Report LCSR-TR-250, Rutgers University, July 1995.Google Scholar
- 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 Scholar
- 23.Olin Shivers. Control-flow analysis of higher-order languages. PhD thesis, Carnegie Mellon University, Pittsburgh, PA, May 1991. Google Scholar
Index Terms
Simple and effective analysis of statically-typed object-oriented programs







Comments