Skip to main content

Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 952))

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   74.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ole Agesen and Urs Hölzle. Type Feedback vs. Concrete Type Analysis: A Comparison of Optimization Techniques for Object-Oriented Languages. Technical Report TRCS 95-04, Department of Computer Science, University of California, Santa Barbara, March 1995.

    Google Scholar 

  2. [Agesen et al. 93]_Ole Agesen, Jens Palsberg, and Michael I. Schwartzback. Type Inference of SELF: Analysis of Objects with Dynamic and Multiple Inheritance. In Proceedings ECOOP’ 93, July 1993.

    Google Scholar 

  3. [Agrawal et al. 91]_Rakesh Agrawal, Linda G. DeMichiel, and Bruce G. Lindsay. Static Type Checking of Multi-Methods. In Proceedings OOPSLA’ 91, pages 113–128, November 1991. Published as ACM SIGPLAN Notices, volume 26, number 11.

    Google Scholar 

  4. [AK et al. 89]_Hassan Aït-Kaci, Robert Boyer, Patrick Lincoln, and Roger Nasr. Efficient Implementation of Lattice Operations. ACM Transactions on Programming Languages and Systems, 11(1): 115–146, January 1989.

    Article  Google Scholar 

  5. [Bobrow et al. 88]_D. G. Bobrow, L. G. DeMichiel, R. P. Gabriel, S. E. Keene, G. Kiczales, and D. A. Moon. Common Lisp Object System Specification X3J13. SIGPLAN Notices, 28(Special Issue), September 1988.

    Google Scholar 

  6. Brad Calder and Dirk Grunwald. Reducing Indirect Function Call Overhead in C++ Programs. In Conference Record of POPL’ 94: 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 397–408, Portland, Oregon, January 1994.

    Google Scholar 

  7. Yves Caseau. Efficient Handling of Multiple Inheritance Hierarchies. In Proceedings OOPSLA’93, pages 271–287, October 1993. Published as ACM SIGPLAN Notices, volume 28, number 10.

    Google Scholar 

  8. Craig Chambers and David Ungar. Customization: Optimizing Compiler Technology for Self, A Dynamically-Typed Object-Oriented Programming Language. SIGPLAN Notices, 24(7): 146–160, July 1989. In Proceedings of the ACM SIGPLAN’ 89 Conference on Programming Language Design and Implementation.

    Article  Google Scholar 

  9. Craig Chambers and David Ungar. Iterative Type Analysis and Extended Message Splitting: Optimizing Dynamically-Typed Object-Oriented Programs. SIGPLAN Notices, 25(6):150–164, June 1990. In Proceedings of the ACM SIGPLAN’ 90 Conference on Programming Language Design and Implementation.

    Article  Google Scholar 

  10. Craig Chambers and David Ungar. Making Pure Object-Oriented Languages Practical. In Proceedings OOPSLA’ 91, pages 1–15, November 1991. Published as ACM SIGPLAN Notices, volume 26, number 11.

    Google Scholar 

  11. Craig Chambers. Object-Oriented Multi-Methods in Cecil. In O. Lehrmann Madsen, editor, Proceedings ECOOP’ 92, LNCS 615, pages 33–56, Utrecht, The Netherlands, July 1992. Springer-Verlag.

    Google Scholar 

  12. Craig Chambers. The Cecil Language: Specification and Rationale. Technical Report TR-93-03-05, Department of Computer Science and Engineering. University of Washington, March 1993.

    Google Scholar 

  13. [Chambers et al. 89]_Craig Chambers, David Ungar, and Elgin Lee. An Efficient Implementation of SELF-a Dynamically-Typed Object-Oriented Language Based on Prototypes. In Proceedings OOPSLA’ 89, pages 49–70, October 1989. Published as ACM SIGPLAN Notices, volume 24, number 10.

    Google Scholar 

  14. [Chambers et al. 95]_Craig Chambers, Jeffrey Dean, and David Grove. A Framework for Selective Recompilation in the Presence of Complex Intermodule Dependencies. In 17th International Conference on Software Engineering, Seattle, WA, April 1995.

    Google Scholar 

  15. [Dean et al. 95]_Jeffrey Dean, Craig Chambers, and David Grove. Selective Specialization for Object-Oriented Languages. SIGPLAN Notices, June 1995. In Proceedings of the ACM SIGPLAN’ 95 Conference on Programming Language Design and Implementation.

    Google Scholar 

  16. L. Peter Deutsch and Allan M. Schiffman. Efficient Implementation of the Smalltalk-80 System. In Conference Record of the Eleventh Annual ACM Symposium on Principles of Programming Languages, pages 297–302, Salt Lake City, Utah, January 1984.

    Google Scholar 

  17. Dylan, an Object-Oriented Dynamic Language, April 1992. Apple Computer.

    Google Scholar 

  18. Mary Fernandez. Simple and Effective Link-time Optimization of Modula-3 Programs. SIGPLAN Notices, June 1995. In Proceedings of the ACM SIGPLAN’ 95 Conference on Programming Language Design and Implementation.

    Google Scholar 

  19. [Gabriel et al. 91]_Richard P. Gabriel, Jon L. White, and Daniel G. Bobrow. CLOS: Integrating Object-Oriented and Functional Programming. Communications of the ACM, 34(9):28–38, September 1991.

    Article  Google Scholar 

  20. [Garrett et al. 94]_Charlie Garrett, Jeffrey Dean, David Grove, and Craig Chambers. Measurement and Application of Dynamic Receiver Class Distributions. Technical Report UW-CS 94-03-05, University of Washington, March 1994.

    Google Scholar 

  21. Samuel P. Harbison. Modula-3. Prentice Hall, Englewood Cliffs, NJ, 1992.

    MATH  Google Scholar 

  22. Urs Hölzle and David Ungar. Optimizing Dynamically-Dispatched Calls with Run-Time Type Feedback. SIGPLAN Notices, 29(6): 326–336, June 1994. In Proceedings of the ACM SIGPLAN’ 94 Conference on Programming Language Design and Implementation.

    Article  Google Scholar 

  23. Urs Hölzle. Adaptive Optimization for Self: Reconciling High Performance with Exploratory Programming. PhD thesis, Stanford University, August 1994.

    Google Scholar 

  24. Ralph Johnson. Documenting Frameworks Using Patterns. In Proceedings OOPSLA’ 92, pages 63–76, October 1992. Published as ACM SIGPLAN Notices, volume 27, number 10.

    Google Scholar 

  25. Michael F. Kilian. Why Trellis/Owl Runs Fast. Unpublished manuscript, March 1988.

    Google Scholar 

  26. Doug Lea. Customization in C++. In Proceedings of the 1990 Usenix C+ + Conference, San Francisco, CA, April 1990.

    Google Scholar 

  27. Chu-Cheow Lim and Andreas Stolcke. Sather Language Design and Performance Evaluation. Technical Report TR 91-034, International Computer Science Institute, May 1991.

    Google Scholar 

  28. [Linton et al. 89]_M. A. Linton, J. M. Vlissides, and P. R. Calder. Composing User Interfaces with Interviews. IEEE Computer, 2(2):8–22, February 1989.

    Google Scholar 

  29. Greg Nelson. Systems Programming with Modula-3. Prentice Hall, Englewood Cliffs, NJ, 1991.

    Google Scholar 

  30. Stephen Omohundro. The Sather 1.0 Specification. Unpublished manuscript from International Computer Science Institute, Berkeley, CA, 1994.

    Google Scholar 

  31. [Oxhøj et al. 92]_Nicholas Oxhøj, Jens Palsberg, and Michael I. Schwartzbach. Making Type Inference Practical. In O. Lehrmann Madsen, editor, Proceedings ECOOP’ 92, LNCS 615, pages 329–349, Utrecht, The Netherlands, July 1992. Springer-Verlag.

    Google Scholar 

  32. Jens Palsberg and Michael I. Schwartzbach. Object-Oriented Type Inference. In Proceedings OOPSLA’ 91, pages 146–161, November 1991. Published as ACM SIGPLAN Notices, volume 26, number 11.

    Google Scholar 

  33. Jens Palsberg and Michael I. Schwartzbach. Object-Oriented Type Systems. John Wiley & Sons, 1994.

    Google Scholar 

  34. John Plevyak and Andrew A. Chien. Precise Concrete Type Inference for Object-Oriented Languages. In Proceedings OOPSLA’ 94, pages 324–340, Portland, Oregon, October 1994.

    Google Scholar 

  35. [Schaffert et al. 85]_Craig Schaffert, Topher Cooper, and Carrie Wilpolt. Trellis Object-Based Environment, Language Reference Manual. Technical Report DEC-TR-372, Digital Equipment Corporation, November 1985.

    Google Scholar 

  36. [Schaffert et al. 86]_Craig Schaffert, Topher Cooper, Bruce Bullis, Mike Killian, and Carrie Wilpolt. An Introduction to Trellis/Owl. In Proceedings OOPSLA’ 86, pages 9–16, November 1986. Published as ACM SIGPLAN Notices, volume 21, number 11.

    Google Scholar 

  37. Amitabh Srivastava. Unreachable Procedures in Object-Oriented Programming. ACM Letters on Programming Languages and Systems, 1(4):355–364, December 1992.

    Article  Google Scholar 

  38. Bjarne Stroustrup. The C+ + Programming Language (second edition). Addision-Wesley, Reading, MA, 1991.

    Google Scholar 

  39. [Szypersky et al. 93]_Clemens Szypersky, Stephen Omohundro, and Stephan Murerzw. Engineering a Programming Language: The Type and Class System of Sather. Technical Report 93-064, International Computer Science Institute, Berkeley, CA, 1993.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1995 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Dean, J., Grove, D., Chambers, C. (1995). Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis. In: Tokoro, M., Pareschi, R. (eds) ECOOP’95 — Object-Oriented Programming, 9th European Conference, Åarhus, Denmark, August 7–11, 1995. ECOOP 1995. Lecture Notes in Computer Science, vol 952. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-49538-X_5

Download citation

  • DOI: https://doi.org/10.1007/3-540-49538-X_5

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-60160-9

  • Online ISBN: 978-3-540-49538-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics