Simple and E ective Analysis ofStatically-Typed Object-Oriented ProgramsAmer

To use modern hardware eeectively, compilers need extensive control-ow information. Unfortunately, the frequent method invocations in object-oriented languages obscure control ow. 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-ow information in object-oriented languages. We present simple algorithms for type hierarchy analysis, aggregate analysis, and inter-procedural and intraprocedural type propagation. These algorithms are also fast, O(jproceduresj P procedures p n p v p) worst case time (linear in practice) for our slowest analysis, where n p is the size of procedure p and v p 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 invo-cations that invoke only a single procedure. this document is hereby granted provided that this notice is retained on all copies, that copies are not altered, and that ACM is credited when the material is used to form other copyright policies.

[1]  Jeffrey D. Ullman,et al.  Global Data Flow Analysis and Iterative Algorithms , 1976, J. ACM.

[2]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[3]  Craig Chambers,et al.  Customization: optimizing compiler technology for SELF, a dynamically-typed object-oriented programming language , 1989, PLDI '89.

[4]  Barbara G. Ryder,et al.  Static Type Determination and Aliasing for C , 1990 .

[5]  Craig Chambers,et al.  Iterative type analysis and extended message splitting; optimizing dynamically-typed object-oriented programs , 1990, PLDI '90.

[6]  Jens Palsberg,et al.  Object-oriented type inference , 1991, OOPSLA '91.

[7]  C. Chambers,et al.  Making pure object-oriented languages practical , 1991, OOPSLA '91.

[8]  Greg Nelson,et al.  Systems programming in modula-3 , 1991 .

[9]  Andrew A. Chien,et al.  Precise Concrete Type Inference for Object-Oriented Languages , 1994, OOPSLA.

[10]  Frank Manola,et al.  Generalizing Dispatching in a Distributed Object System , 1994, ECOOP.

[11]  Dirk Grunwald,et al.  Reducing indirect function call overhead in C++ programs , 1994, POPL '94.

[12]  Urs Hölzle,et al.  Optimizing dynamically-dispatched calls with run-time type feedback , 1994, PLDI '94.

[13]  Mary F. Fernández,et al.  Simple and effective link-time optimization of Modula-3 programs , 1995, PLDI '95.

[14]  Simple and Effective Link-Time Optimization of Modula-3 Programs , 1995, PLDI.

[15]  Urs Hölzle,et al.  Type feedback vs. concrete type inference: a comparison of optimization techniques for object-oriented languages , 1995, OOPSLA.

[16]  David Grove,et al.  Profile-guided receiver class prediction , 1995, OOPSLA.

[17]  David Grove,et al.  Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis , 1995, ECOOP.

[18]  Urs Hölzle,et al.  Eliminating Virtual Function Calls in C++ Programs , 1996, ECOOP.

[19]  David F. Bacon,et al.  Fast static analysis of C++ virtual function calls , 1996, OOPSLA '96.