Optimizing dynamically-dispatched calls with run-time type feedback

Abstrach Object-oriented programs are difficult to optimize because they execute many dynamically-dispatched calls. These calls cannot easily be eliminated because the compiler does not know which callee will be invoked at runtime. We have developed a simple technique that feeds back type information from the runtime system to the compiler. With this type feedback, the compiler can inline any dynamically-dispatched call. Our compiler drastically reduces the calI frequency of a suite of large SELF applications (by a factor of 3.6) and improves performance by a factor of 1.7. We believe that type feedback could significantly reduce call frequencies and improve performance for most other objectoriented languages (statically-typed or not) as well as for languages with type-dependent operations such as generic arithmetic.

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

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

[3]  Jens Palsberg,et al.  Type Inference of SELF , 1993, ECOOP.

[4]  Barbara G. Ryder,et al.  Static Type Determination for C++ , 1994, C++ Conference.

[5]  Mark Baldwin Reinhold CACHE PERFORMANCE OF GARBAGE-COLLECTED PROGRAMMING LANGUAGES , 1993 .

[6]  Susan L. Graham,et al.  An execution profiler for modular programs , 1983, Softw. Pract. Exp..

[7]  Mary Hall Managing interprocedural optimization , 1992 .

[8]  David Keppel,et al.  Shade: a fast instruction-set simulator for execution profiling , 1994, SIGMETRICS.

[9]  Alan Jay Smith,et al.  Aspects of cache memory and instruction buffer performance , 1987 .

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

[11]  Leonidas J. Guibas,et al.  Compilation and delayed evaluation in APL , 1978, POPL.

[12]  Bay-Wei Chang,et al.  Animation: from cartoons to the user interface , 1993, UIST '93.

[13]  David W. Wall,et al.  A practical system fljr intermodule code optimization at link-time , 1993 .

[14]  Bjørn N. Freeman-Benson,et al.  Multi‐way versus one‐way constraints in user interfaces: Experience with the deltablue algorithm , 1993, Softw. Pract. Exp..

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

[16]  Karel Driesen Selector table indexing & sparse arrays , 1993, OOPSLA '93.

[17]  Jack W. Davidson,et al.  A study of a C function inliner , 1988, Softw. Pract. Exp..

[18]  Peter Lee,et al.  Cache behavior of combinator graph reduction , 1992, TOPL.

[19]  Wen-mei W. Hwu,et al.  Inline function expansion for compiling C programs , 1989, PLDI '89.

[20]  David W. Wall,et al.  Predicting program behavior using real or estimated profiles , 2004, SIGP.

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

[22]  Ronald L. Johnston The Dynamic Incremental Compiler of APL\3000 , 1979, APL '79.

[23]  Paul R. Calder,et al.  Composing user interfaces with InterViews , 1989, Computer.

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

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

[26]  Craig Chambers,et al.  The cecil language: specification and rationale , 1993 .

[27]  James G. Mitchell The Design and Construction of Flexible and Efficient Interactive Programming Systems , 1970, Outstanding Dissertations in the Computer Sciences.

[28]  Urs Hölzle,et al.  Adaptive optimization for self: reconciling high performance with exploratory programming , 1994 .

[29]  Keith D. Cooper,et al.  An experiment with inline substitution , 1991, Softw. Pract. Exp..

[30]  Scott A. Mahlke,et al.  Profile‐guided automatic inline expansion for C programs , 1992, Softw. Pract. Exp..

[31]  Craig Chambers,et al.  An efficient implementation of SELF, a dynamically-typed object-oriented language based on prototypes , 1989, OOPSLA '89.

[32]  Mark D. Hill,et al.  Aspects of Cache Memory and Instruction , 1987 .

[33]  Amer Diwan,et al.  Memory subsystem performance of programs using copying garbage collection , 1994, POPL '94.

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

[35]  Craig Chambers,et al.  Debugging optimized code with dynamic deoptimization , 1992, PLDI '92.

[36]  Amer Diwan,et al.  Memory system performance of programs with intensive heap allocation , 1995, TOCS.