Dynamic dispatch in object-oriented languages

Dynamic binding in object-oriented languages is perhaps the most important semantic aspect of these languages. At the same time it can contribute to ine ciency and lack of robustness because it incurs lookup overheads on function calls and hinders the compiler determining the exact type of objects held in variables or returned by functions. This may, for instance, preclude inlining of small functions or attribute o set computation at compile time. Yet attribute accesses are the most frequently executed operations. As a result, to regain lost performance, OO programmers are tempted to break the encapsulation of classes or want explicit control over dynamic dispatch, trading o extensibility. In the implementation of parallel object-oriented languages the additional complication arises that object accesses may require more expensive remote memory accesses. Lookup at the call may be inappropriate if the code has to be executed on a di erent processor and there perhaps has a di erent address. This paper summarizes dispatching as addressed in several modern object-oriented languages. We then describe and benchmark fast and exible dispatch schemes that we are currently implementing on SPARC based workstations and multi-processors. These involve elements of C++ virtual function tables and Ei el's and Sather's ability to rede ne abstract functions as attributes. Initial benchmarks seem to promise improved e ciency on a range of modern RISC based architectures.

[1]  J. Grosch,et al.  A Tool Box for Compiler Construction , 1990, CC.

[2]  John R. Rose,et al.  Fast dispatch mechanisms for stock hardware , 1988, OOPSLA '88.

[3]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[4]  Craig Chambers,et al.  Object, message, and performance: how they coexist in Self , 1992, Computer.

[5]  Luca Cardelli,et al.  Basic Polymorphic Typechecking , 1987, Sci. Comput. Program..

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

[7]  David A. Moon,et al.  The Common List Object-Oriented Programming Language Standard , 1989, Object-Oriented Concepts, Databases, and Applications.

[8]  Bjarne Stroustrup,et al.  The Annotated C++ Reference Manual , 1990 .

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

[10]  A. Stolcke,et al.  Sather Language Design and Performance Evaluation , 1991 .

[11]  Stephen M. Omohundro,et al.  The Sather programming language , 1993 .

[12]  Hans-Juergen Boehm,et al.  Garbage collection in an uncooperative environment , 1988, Softw. Pract. Exp..

[13]  Benjamin G. Zorn,et al.  A comparison of object‐oriented programming in four modern languages , 1994, Softw. Pract. Exp..

[14]  Josef Grosch,et al.  Transformation of Attributed Trees Using Pattern Matching , 1992, CC.

[15]  Andreas Paepcke Object-oriented programming: the CLOS perspective , 1993 .