Fast and Compact Dispatching for Dynamic Object-Oriented Languages
نویسنده
چکیده
Dynamic Object-Oriented languages allows for dynamic deenition of new classes, new generic functions and new methods. This paper proposes a single and compact data structure to, at the same time, facilitate the addition of new classes, generic functions or methods, and still ensure a fast method selection. Within a dynamic Object-Oriented language, new classes, new generic functions and new methods may be created at run-time. We assume the CLOS model BDG + 88] where a generic function is a dispatching function over a set of methods. When invoked, a generic function executes its most appropriate method based on the class of its arguments. This dispatching process, or method selection, has been well studied KR90,Ros91,HC92,AGS94,VH94,CT95] and its eeciency is based on the elaboration of a speciic dispatch structure; see VH94] for a detailed comparison. The dynamic character of the language requires the implementation to be able to regenerate the dispatch structure whenever a class, a generic function or a method is added. Our paper proposes to implement the dispatch structure with a decision tree, respecting the inheritance tree thus making easy these additions and yet providing a fast dispatch mechanism based on a speciic numbering of classes. While multiple dispatch is addressed in section 5, our solution is particularly useful for languages with single inheritance and single-method dispatch: the Smalltalk case GR83], where the method is selected according to the class of a distinguished argument: the receiver. The examples of the rest of the paper are based on the tree of classes shown on gure 1
منابع مشابه
Addressing Dynamic Dispatching Issues in WCET Analysis for Object-Oriented Hard Real-Time Systems
There is a trend towards using object-oriented programming languages to develop hard real-time applications. However, some object-oriented features, such as dynamic dispatching and dynamic loading, are prohibited from being used in hard realtime systems because they are either unpredictable and/or unanalysable. Arguably, these restrictions could make applications very limited and unrealistic si...
متن کاملWhole-Program Optimization of Object-Oriented Languages
Whole-Program Optimization of Object-Oriented Languages by Jeffrey Adgate Dean Chairperson of the Supervisory Committee: Professor Craig Chambers Department of Computer Science and Engineering This dissertation examines the use of whole-program optimization as a way of improving the performance of object-oriented programming languages. Although object-oriented programming conveys a number of so...
متن کامل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 fun...
متن کاملEfficient Dynamic Look-Up Strategy for Multi-Methods
In object-oriented programming languages, multiple dispatching provides increased expressive power over single dispatching by guiding method lookup using the values of all arguments instead of the receiver only. There have been several programming languages supporting this mechanism and they demonstrate its usefulness. However, efficient implementation of multi-methods is critical with regard t...
متن کاملFast Algorithms for Compressed Multi-Method Dispatch Tables Generation
The eeciency of dynamic dispatch is a major impediment to the adoption of multi-methods in object-oriented languages. In this paper, we propose a simple multi-method dispatch scheme based on compressed dispatch tables. This scheme is applicable to any object-oriented language using a method precedence order that satisses a speciic monotonous property (e.g., as Cecil and Dylan), and guarantees t...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Inf. Process. Lett.
دوره 64 شماره
صفحات -
تاریخ انتشار 1997