Abstract
Object-oriented programming languages provide many software engineering benefits, but these often come at a performance cost. Object-oriented programs make extensive use of method invocations and pointer dereferences, both of which are potentially costly on modern machines. We show how to use types to produce effective, yet simple, techniques that reduce the costs of these features in Modula-3, a statically typed, object-oriented language. Our compiler performs type-based alias analysis to disambiguate memory references. It uses the results of the type-based alias analysis to eliminate redundant memory references and to replace monomorphic method invocation sites with direct calls. Using limit, static, and running time evaluation, we demonstrate that these techniques are effective, and sometimes perfect for a set of Modula-3 benchmarks.
- Agesen, O. and Holzle, U. 1995. Type feedback vs. concrete type inference: A comparison of optimization techniques for object-oriented languages. In Proceedings of the ACM SIGPLAN '95 Conference on Object-Oriented Programming Systems, Languages, and Applications. ACM, Austin, Texas, 91-107. Google Scholar
- Aho, A. V., Sethi, R., and Ullman, J. D. 1986. Compilers: Principles, Techniques, and Tools. Addison-Wesley. Google Scholar
- Aigner, G. and Holzle, U. 1996. Eliminating virtual function calls in C++ programs. In Proceedings of European Conference on Object-Oriented Programming. Linz, Austria, 142-166. Google Scholar
- Anderson, L. O. 1994. Program analysis and specialization for the C programming language. Ph.D. thesis, DIKU.Google Scholar
- Bacon, D. and Sweeney, P. 1996. Fast static analysis of C++ virtual function calls. In Proceedings of the ACM SIGPLAN '96 Conference on Object-Oriented Programming Systems, Languages, and Applications. ACM, ACM Press, San Jose, CA, 324-341. Google Scholar
- Banning, J. 1979. An efficient way to effnd side effects of procedure calls and aliases of variables. In Conference Record of the Sixth Annual ACM SIGACT/SIGPLAN Symposium on Principles of Programming Languages. San Antonio, Texas, 29-41. Google Scholar
- Bates, R. M. 1994. K-trees. Personal communication.Google Scholar
- Burke, M., Carini, P. R., Choi, J.-D., and Hind, M. 1994. Ecient ow-insensitive alias analysis in the presence of pointers. Tech. Rep. 19546, IBM T.J. Watson Research Center, Yorktown Heights, NY. Sept.Google Scholar
- Calder, B. and Grunwald, D. 1994. Reducing indirect function call overhead in C++ programs. In 21st Symposium on Principles of Programming Languages. ACM, Portland, Oregon, 397- 408. Google Scholar
- Calder, B., Grunwald, D., and Emer, J. 1995. A system level perspective on branch architecture performance. In 28th International Symposium on Microarchitecture. 199-206. Google Scholar
- Calder, B., Grunwald, D., and Zorn, B. 1994. Quantifying behavioral differences between C and C++ programs. Tech. Rep. CU-CS-698-94, University of Colorado, Boulder, CO. Jan.Google Scholar
- Chambers, C. 1992. The design and evaluation of the SELF compiler, an optimizing compiler for object-oriented programming languages. Ph.D. thesis, Stanford University, CA. Google Scholar
- Chambers, C., Dean, J., and Grove, D. 1996. Whole-program optimization of object-oriented languages. Tech. Rep. 96-06-02, University of Washington, Seattle, Washington. June. Google Scholar
- Chambers, C. and Ungar, D. 1989. Customization: Optimizing compiler technology for SELF, a dynamically-typed object-oriented programming language. In Proceedings of the ACM SIG- PLAN '89 Conference on Programming Language Design and Implementation. 146-160. Google Scholar
- Chambers, C. and Ungar, D. 1991. Making pure object oriented languages practical. In Proceedings of the ACM SIGPLAN '91 Conference on Object-Oriented Programming Systems, Languages, and Applications. 1-15. Google Scholar
- Chase, D. R., Wegman, M., and Zadeck, F. K. 1990. Analysis of pointers and structures. In Proceedings of the ACM SIGPLAN '90 Conference on Programming Language Design and Implementation. 296-310. Google Scholar
- Chatterjee, R., Ryder, B. G. , and Landi, W. A. 1999. Relevant context inference. In Proceedings of 26th ACM SIGACT/SIGPLAN Symposium on Principles of Programming Languages. ACM, 133-146. Google Scholar
- Chatterjee, R. K. and Ryder, B. G. 1997a. Modular concrete type-inference for statically typed object-oriented programming languages. Tech. Rep. DCS-TR-349, Rutgers University. Nov.Google Scholar
- Chatterjee, R. K. and Ryder, B. G. 1997b. Scalable, ow-sensitive type-inference for statically typed object-oriented programming languages. Tech. Rep. DCS-TR-326, Rutgers University. July.Google Scholar
- Choi, J.-D., Burke, M., and Carini, P. 1993. Efficient ow-sensitive interprocedural computation of pointer-induced aliases and side effects. In Conference Record of the Twentieth Annual ACM SIGACT/SIGPLAN Symposium on Principles of Programming Languages. Charleston, SC, 232-245. Google Scholar
- Cooper, K.andLu, J.1997. Register promotion in C programs. In Proceedings of the ACM SIGPLAN '97 Conference on Programming Language Design and Implementation. Las Vegas, Nevada, 308-319. Google Scholar
- Cooper, K. D. and Kennedy, K. 1989. Fast interprocedural alias analysis. In Conference Record of the Sixteenth Annual ACM SIGACT/SIGPLAN Symposium on Principles of Programming Languages. 49-59. Google Scholar
- Dean, J., Chambers, C., and Grove, D. 1994. Identifying profitable specialization in objectoriented languages. In ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation. Association of Computing Machinery, Orlando, FL.Google Scholar
- Dean, J., DeFouw, G., Grove, D., Litvinov, V., and Chambers, C. 1996. Vortex: An optimizing compiler for object-oriented languages. In Proceedings of the ACM SIGPLAN '96 Conference on Object-Oriented Programming Systems, Languages, and Applications. San Jose, CA, 83-100. Google Scholar
- Dean, J., Grove, D., and Chambers, C. 1995. Optimization of object-oriented programs using static class hierarchy analysis. In Proceedings of European Conference on Object-Oriented Programming. Aarhus, Denmark, 77-101. Google Scholar
- Debray, S., Muth, R., and Weippert, M. 1998. Alias analysis of executable code. In Conference Record of the Twenty Fifth Annual ACM SIGPLAN/SIGACT Symposium on Principles of Programming Languages. Google Scholar
- DeFouw, G., Grove, D., and Chambers, C. 1998. Fast interprocedural class analysis. In Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages. ACM, 222-236. Google Scholar
- Deutsch, A. 1994. Interprocedural May-Alias analysis for pointers: Beyond k-limiting. In Proceedings of the ACM SIGPLAN '94 Conference on Programming Language Design and Implementation. 230-241. Google Scholar
- Diwan, A. 1996. Understanding and improving the performance of modern programming languages. Ph.D. thesis, University of Massachusetts, Amherst, MA 01003. Google Scholar
- Diwan, A., McKinley, K. S., and Moss, J. E. B. 1998. Type-based alias analysis. In Proceedings of the ACM SIGPLAN '98 Conference on Programming Language Design and Implementation. Montreal, 106-117. Google Scholar
- Diwan, A., Moss, E., and McKinley, K. S. 1996. Simple and effective analysis of statically typed object-oriented programs. In Proceedings of the ACM SIGPLAN '96 Conference on Object-Oriented Programming Systems, Languages, and Applications. San Jose, CA, 292-305. Google Scholar
- Driesen, K. and Holzle, U. 1996. The direct cost of virtual function calls in C++. In Proceedings of the ACM SIGPLAN '96 Conference on Object-Oriented Programming Systems, Languages, and Applications. San Jose, CA, 306-323. Google Scholar
- Emami, M., Ghiya, R., and Hendren, L. J. 1994. Context-sensitive interprocedural Pointsto analysis in the presence of function pointers. In Proceedings of the ACM SIGPLAN '94 Conference on Programming Language Design and Implementation. 242-256. Google Scholar
- Emer, J., Webb, D., and McCallig, M. 1996. Zippy simulator for alpha workstations. Software.Google Scholar
- Fernandez, M. F. 1995. Simple and effective link-time optimization of Modula-3 programs. In Proceedings of Conference on Programming Language Design and Implementation. SIGPLAN, ACM Press, La Jolla, CA, 103-115. Google Scholar
- Ghiya, R. and Hendren, L. J. 1998. Putting pointer analysis to work. In Conference Record of the Twenty Fifth Annual ACM SIGPLAN/SIGACT Symposium on Principles of Programming Languages. 121-133. Google Scholar
- Grove, D., Dean, J., Garrett, C., and Chambers, C. 1995. Profile-guided receiver class prediction. In Proceedings of the ACM SIGPLAN '95 Conference on Object-Oriented Programming Systems, Languages, and Applications. ACM, Austin, Texas, 108-123. Google Scholar
- Hall, M. W. 1991. Managing interprocedural optimizations. Ph.D. thesis, Rice University, Houston, Texas. Google Scholar
- Hennessy, J. and Patterson, D. 1995. Computer Architecture A Quantitative Approach. Morgan-Kaufmann. Google Scholar
- Hind, M., Burke, M., Carini, P., and Choi, J.-D. 1999. Interprocedural pointer alias analysis. ACM Transactions on Programming Languages and Systems 21, 4 (July), 848-894. Google Scholar
- Holzle, U. and Ungar, D. 1994. Optimizing dynamically-dispatched calls with run-time type feedback. In Proceedings of the ACM SIGPLAN '94 Conference on Programming Language Design and Implementation. ACM, 326-336. Google Scholar
- Hummel, J., Hendren, L. J., and Nicolau, A. 1994. A general data dependence test for dynamic, pointer-based data structures. In Proceedings of the ACM SIGPLAN '94 Conference on Programming Language Design and Implementation. 218-229. Google Scholar
- Kalsow, B. and Muller, E. 1995. SRC Modula-3 Version 3.5. Systems Research Center, Digital Equipment Corporation, Palo Alto, CA.Google Scholar
- Kam, J. B. and Ullman, J. D. 1976. Global data ow analysis and iterative algorithms. Journal of the ACM 7, 3, 305-318. Google Scholar
- Landi, W. and Ryder, B. G. 1991. Pointer-induced aliasing: a problem classification. In Conference Record of the Eighteenth Annual ACM SIGACT/SIGPLAN Symposium on Principles of Programming Languages. Orlando, FL, 93-103. Google Scholar
- Landi, W. and Ryder, B. G. 1992. Interprocedural side effect analysis with pointer aliasing. In Proceedings of the ACM SIGPLAN '92 Conference on Programming Language Design and Implementation. San Francisco, CA, 235-248. Google Scholar
- Larus, J. R. and Chandra, S. 1993. Using tracing and dynamic slicing to tune compilers. University of Wisconsin Technical Report 1174.Google Scholar
- Larus, J. R. and Hilfinger, P. N. 1988. Detecting con icts between structure accesses. In Proceedings of the ACM SIGPLAN '88 Conference on Programming Language Design and Implementation. Atlanta, GA, 21-34. Google Scholar
- Liskov, B. and Guttag, J. 1986. Abstraction and Specification in Program Development. MIT Press. Google Scholar
- Lucassen, J. M. and Gifford, D. 1988. Polymorphic effect systems. In 15th ACM SIGPLAN- SIGACT Symposium on Principles of Programming Languages. ACM, 47-57. Google Scholar
- Nayeri, F., Hurwitz, B., and Manola, F. 1994. Generalizing dispatching in a distributed object system. In Proceedings of European Conference on Object-Oriented Programming. Bologna, Italy, 450-473. Google Scholar
- Nelson, G., Ed. 1991. Systems Programming with Modula-3. Prentice Hall, New Jersey. Google Scholar
- Nystrom, N., Hosking, A. L., Whitlock, D., Cutts, Q., and Diwan, A. 1999. Partial redundancy elimination for access path expressions. In Proceedings of the International Workshop on Aliasing in Object-Oriented Systems. Lisbon, Portugal. Revision of Purdue University Computer Sciences Technical Report 98-044.Google Scholar
- Palsberg, J. and Schwartzbach, M. I. 1991. Object-oriented type inference. In Proceedings of the ACM SIGPLAN '91 Conference on Object-Oriented Programming Systems, Languages, and Applications. SIGPLAN, ACM Press, Pheonix, Arizona, 146-162. Google Scholar
- Pande, H. and Ryder, B. G. 1995. Static type determination and aliasing for C++. Tech. Rep. LCSR-TR-250, Rutgers University. July. A version of this appeared in Proceedings of the Third International Static Analysis Symposium (SAS'96).Google Scholar
- Plevyak, J. and Chien, A. 1994. Precise concrete type inference for object-oriented languages. In Proceedings of the ACM SIGPLAN '94 Conference on Object-Oriented Programming Systems, Languages, and Applications. ACM, 324-340. Google Scholar
- Reinig, A. G. 1998. Alias analysis in the DEC C and DIGITAL C++ compilers. DIGITAL Technical Journal 10, 1 (Dec.).Google Scholar
- Rinard, M. C. and Diniz, P. C. 1996. Commutativity analysis: A new analysis framework for parallelizing compilers. In Proceedings of the ACM SIGPLAN '96 Conference on Programming Language Design and Implementation. Philadelphia, PA, 54-67. Google Scholar
- Ruf, E. 1995. Context-insensitive alias analysis reconsidered. In Proceedings of the ACM SIG- PLAN '95 Conference on Programming Language Design and Implementation. La Jolla, CA, 13-22. Google Scholar
- Ruf, E. 1997. Partitioning data ow analyses using types. In Conference Record of the Twenty Fourth Annual ACM SIGPLAN/SIGACT Symposium on Principles of Programming Languages. Paris, France, 15-26. Google Scholar
- Shapiro, M. and Horwitz, S. 1997a. The effects of the precision of pointer analysis. In Lecture Notes in Computer Science, 1302, P. V. Hentenryck, Ed. Springer-Verlag, 16-34. Proceedings from the 4th International Static Analysis Symposium. Google Scholar
- Shapiro, M. and Horwitz, S. 1997b. Fast and accurate ow-insensitive points-to analysis. In Conference Record of the Twenty Fourth Annual ACM SIGPLAN/SIGACT Symposium on Principles of Programming Languages. Paris, France, 1-14. Google Scholar
- Shivers, O. 1991. Control-Flow Analysis of Higher-Order Languages. Ph.D. thesis, Carnegie- Mellon University, Pittsburgh, PA. Google Scholar
- Srivastava, A. and Eustace, A. 1994. ATOM: A system for building customized program analysis tools. In Proceedings of the ACM SIGPLAN '94 Conference on Programming Language Design and Implementation. Association of Computing Machinery, Orlando, FL, 196-205. Google Scholar
- Stallman, R. M. 1989. Gnu C Compiler. Free Software Foundation, Cambridge, MA. Software distribution.Google Scholar
- Steensgaard, B. 1996. Points-to analysis in almost linear time. In Conference Record of the Twenty Third Annual ACM SIGPLAN/SIGACT Symposium on Principles of Programming Languages. Association of Computing Machinery, 32-41. Google Scholar
- Sun Microsystems Computer Corporation 1995. The Java language specification, 1.0 Beta ed. Sun Microsystems Computer Corporation.Google Scholar
- Tarjan, R. E. 1975. On the efficiency of a good but not linear set union algorithm. Journal of the ACM 22, 2, 215-225. Google Scholar
- Wall, D. W. 1991. Limits of instruction-level parallelism. In Proceedings of the Fourth International Conference on Architectural Support for Programming Languages and Operating Systems. Santa Clara, California, 176-189. Google Scholar
- Weihl, W. E. 1980. Interprocedural data ow analysis in the presence of pointers, procedure variables and label variables. In Conference Record of the Seventh Annual ACM SIGACT/SIGPLAN Symposium on Principles of Programming Languages. Las Vegas, Nevada, 83-94. Google Scholar
- Wilson, R. P. 1997. Efficient context-sensitive pointer analysis for C programs. Ph.D. thesis, Stanford University, Palo Alto, CA. Google Scholar
- Wilson, R. P. and Lam, M. S. 1995. Efficient context-sensitive pointer analysis for C programs. In Proceedings of the ACM SIGPLAN '95 Conference on Programming Language Design and Implementation. Association of Computing Machinery, La Jolla, CA, 1-12. Google Scholar
Index Terms
Using types to analyze and optimize object-oriented programs
Recommendations
Building a bridge between pointer aliases and program dependences
In this paper we present a surprisingly simple reduction of the program dependence problem to the may-alias problem. While both problems are undecidable, providing a reduction between them has great practical importance. Program dependence information ...
Equivalence analysis and its application in improving the efficiency of program slicing
Existing methods for handling pointer variables during dataflow analyses can make such analyses inefficient in both time and space because the data-flow analyses must store and propagate large sets of data facts that are introduced by dereferences of ...
Precise flow-insensitive may-alias analysis is NP-hard
Determining aliases is one of the foundamental static analysis problems, in part because the precision with which this problem is solved can affect the precision of other analyses such as live variables, available expressions, and constant propagation. ...






Comments