Chapter

ECOOP’95 — Object-Oriented Programming, 9th European Conference, Åarhus, Denmark, August 7–11, 1995

Volume 952 of the series Lecture Notes in Computer Science pp 77-101

Date:

Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis

  • Jeffrey DeanAffiliated withDepartment of Computer Science and Engineering, University of Washington
  • , David GroveAffiliated withDepartment of Computer Science and Engineering, University of Washington
  • , Craig ChambersAffiliated withDepartment of Computer Science and Engineering, University of Washington

* Final gross prices may vary according to local VAT.

Get Access

Abstract

Optimizing compilers for object-oriented languages apply static class analysis and other techniques to try to deduce precise information about the possible classes of the receivers of messages; if successful, dynamically-dispatched messages can be replaced with direct procedure calls and potentially further optimized through inline-expansion. By examining the complete inheritance graph of a program, which we call class hierarchy analysis, the compiler can improve the quality of static class information and thereby improve run-time performance. In this paper we present class hierarchy analysis and describe techniques for implementing this analysis effectively in both statically- and dynamically-typed languages and also in the presence of multi-methods. We also discuss how class hierarchy analysis can be supported in an interactive programming environment and, to some extent, in the presence of separate compilation. Finally, we assess the bottom-line performance improvement due to class hierarchy analysis alone and in combination with two other “competing” optimizations, profile-guided receiver class prediction and method specialization.