Type Directed Cloning for Object-Oriented Programs

Object-oriented programming encourages the use of small functions, dynamic dispatch (virtual functions), and inheritance for code reuse. As a result, such programs typically suffer from inferior performance. The problem is that polymorphic functions do not know the exact types of the data they operate on, and hence must use indirection to operate on them. However, most polymorphism is parametric (e.g. templates in C++) which is amenable to elimination through code replication. We present a cloning algorithm which eliminates parametric polymorphism while minimizing code duplication. The effectiveness of this algorithm is demonstrated on a number of concurrent object-oriented programs. Finally, since functions and data structures can be parameterized over properties other than type, this algorithm is applicable to general forward data flow problems.

[1]  L. Peter Deutsch,et al.  Efficient implementation of the smalltalk-80 system , 1984, POPL.

[2]  Jens Palsberg,et al.  Making Type Inference Practical , 1992, ECOOP.

[3]  Craig Chambers,et al.  The design and implementation of the self compiler, an optimizing compiler for object-oriented programming languages , 1992 .

[4]  Michael A. Harrison,et al.  Accurate static estimators for program optimization , 1994, PLDI '94.

[5]  Randall B. Smith,et al.  SELF: The power of simplicity , 1987, OOPSLA '87.

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

[7]  Ken Kennedy,et al.  A Methodology for Procedure Cloning , 1993, Computer languages.

[8]  Xingbin Zhang,et al.  A Hybrid Execution Model for Fine-Grained Languages on Distributed Memory Multicomputers , 1995, Proceedings of the IEEE/ACM SC95 Conference.

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

[10]  Dirk Grunwald,et al.  Quantifying Behavioral Differences Between C and C++ Programs , 1994 .

[11]  Craig Chambers,et al.  Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches , 1991, ECOOP.

[12]  Ken Kennedy,et al.  Evaluation of compiler optimizations for Fortran D on MIMD distributed memory machines , 1992, ICS '92.

[13]  Ken Kennedy,et al.  Procedure cloning , 1992, Proceedings of the 1992 International Conference on Computer Languages.

[14]  Ken Kennedy,et al.  Interprocedural transformations for parallel code generation , 1991, Proceedings of the 1991 ACM/IEEE Conference on Supercomputing (Supercomputing '91).

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

[16]  Mary Hall Managing interprocedural optimization , 1992 .

[17]  Andrew A. Chien,et al.  Concurrent Aggregates: Supporting Modularity in Massively Parallel Programs , 1993 .

[18]  Peter Lee,et al.  Topics in advanced language implementation , 1991 .

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

[20]  Andrew A. Chien,et al.  Obtaining sequential efficiency for concurrent object-oriented languages , 1995, POPL '95.

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

[22]  John M. Mellor-Crummey,et al.  FIAT: A Framework for Interprocedural Analysis and Transfomation , 1993, LCPC.

[23]  Ken Kennedy,et al.  The impact of interprocedural analysis and optimization in the Rn programming environment , 1986, TOPL.

[24]  Suresh Jagannathan,et al.  A unified treatment of flow analysis in higher-order languages , 1995, POPL '95.

[25]  Jens Palsberg,et al.  Type inference of SELF: Analysis of objects with dynamic and multiple inheritance , 1995, Softw. Pract. Exp..

[26]  Olin Shivers,et al.  Data-flow analysis and type recovery in Scheme , 1990 .

[27]  David Grove,et al.  Identifying Profitable Specialization in Object-Oriented Languages , 1994, PEPM.

[28]  Ken Kennedy,et al.  Interprocedural compilation of Fortran D for MIMD distributed-memory machines , 1992, Proceedings Supercomputing '92.