|
Object-oriented(OO) software systems suffer from poor execution efficiency due to larger number of indirect accesses. Frequent object creation and destruction, and lots of polymorphic message sendings.These are central issues in therun- time environment of OO systems. To improve the overall efficiency,it is crucial to reduce indirect access, designefficient memory allocator (or garbage collector) and use a betterstrategy for message dispatch adapting to various language implementationsincluding statically typed languages such as C++ and Eiffel,and dynamicallytyped environment like Smalltalk and SELF. In our research, we focus on theissues of dynamic message sending and in behavior and improve several existing techniques for constructing fast lookup cache for method search. Since the run time behaviors differ substantially for various application domains and code patterns, the optimization should be domain or patternspecific. The proposed concept of control cache tries to capture the difference between data access and control transfer and preserve special traitsin OO environment like class information, object instance, binding type of variable, message selector and method body. These are all "subjects" attending in a transfer of control. What we want to optimize is to make frequently accessed "subject" fast and store necessary informationin appropriate time. Different code patterns for specific applications will have different roles in an uncertain extent. For dealing with the problems of dynamic method dispatch, we must consider several issues, including biding constraint, time and intermediate space for table construction in compile time, table access efficiency and table size during execution time and whether the designated schema allow dynamic resolution of message selectors for name conflict in multiple inheritance. The basic idea behind the proposed schema for constructing lookup cache is to explore maximum space reduction for dispatch table and achieve efficient table access. Practical issues such as name conflict problems inmultiple inheritance and error detection for unknown messages are discussed and implemented. Comparisons aremade with conventional method resolutions of offset, name and dispatch function in terms of time of schema construction, table space overhead and dispatch efficiency.
|