Optimizing dynamically-typed object-oriented languages with polymorphic inline caches

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 512)

Abstract

Polymorphic inline caches (PICs) provide a new way to reduce the overhead of polymorphic message sends by extending inline caches to include more than one cached lookup result per call site. For a set of typical object-oriented SELF programs, PICs achieve a median speedup of 11%.

As an important side effect, PICs collect type information by recording all of the receiver types actually used at a given call site. The compiler can exploit this type information to generate better code when recompiling a method. An experimental version of such a system achieves a median speedup of 27% for our set of SELF programs, reducing the number of non-inlined message sends by a factor of two.

Implementations of dynamically-typed object-oriented languages have been limited by the paucity of type information available to the compiler. The abundance of the type information provided by PICs suggests a new compilation approach for these languages, adaptive compilation. Such compilers may succeed in generating very efficient code for the time-critical parts of a program without incurring distracting compilation pauses.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [BI82]
    A. H. Borning and D. H. H. Ingalls, “A Type Declaration and Inference System for Smalltalk.” In Conference Record of the Ninth Annual Symposium on Foundations of Computer Science, pp. 133–139, 1982.Google Scholar
  2. [Cha91]
    Craig Chambers, The Design and Implementation of the SELF Compiler, an Optimizing Compiler for Object-Oriented Programming Languages. Ph.D. Thesis, Stanford University. In preparation.Google Scholar
  3. [CPL83]
    Thomas J. Conroy and Eduardo Pelegri-Llopart, “An Assessment of Method-Lookup Caches for Smalltalk-80 Implementations.” In [Kra83].Google Scholar
  4. [CU89]
    Craig Chambers and David Ungar, “Customization: Optimizing Compiler Technology for SELF, a Dynamically-Typed Object-Oriented Programming Language.” In Proceedings of the SIGPLAN '89 Conference on Programming Language Design and Implementation, Portland, OR, June 1989. Published as SIGPLAN Notices 24(7), July, 1989.Google Scholar
  5. [CUL89]
    Craig Chambers, David Ungar, and Elgin Lee, “An Efficient Implementation of SELF, a Dynamically-Typed Object-Oriented Language Based on Prototypes.” In OOPSLA '89 Conference Proceedings, pp. 49–70, New Orleans, LA, 1989. Published as SIGPLAN Notices 24(10), October, 1989.Google Scholar
  6. [CU90]
    Craig Chambers and David Ungar, “Iterative Type Analysis and Extended Message Splitting: Optimizing Dynamically-Typed Object-Oriented Programs.” In Proceedings of the SIGPLAN '90 Conference on Programming Language Design and Implementation, White Plains, NY, June, 1990. Published as SIGPLAN Notices 25(6), June, 1990.Google Scholar
  7. [CU91]
    Craig Chambers and David Ungar, “Making Pure Object-Oriented Languages Practical.” To be presented at OOPSLA '91, Phoenix, AZ, October, 1991.Google Scholar
  8. [Deu83]
    L. Peter Deutsch, “The Dorado Smalltalk-80 Implementation: Hardware Architecture's Impact on Software Architecture.” In [Kra83].Google Scholar
  9. [DMSV89]
    R. Dixon, T. McKee, P. Schweitzer, and M. Vaughan, “A Fast Method Dispatcher for Compiled Languages with Multiple Inheritance.” In OOPSLA '89 Conference Proceedings, pp. 211–214, New Orleans, LA, October, 1989. Published as SIGPLAN Notices 24(10), October, 1989.Google Scholar
  10. [DS84]
    L. Peter Deutsch and Alan Schiffman, “Efficient Implementation of the Smalltalk-80 System.” Proceedings of the 11th Symposium on the Principles of Programming Languages, Salt Lake City, UT, 1984.Google Scholar
  11. [ES90]
    Margaret A. Ellis and Bjame Stroustrup, The Annotated C++ Reference Manual. Addison-Wesley, Reading, MA, 1990.Google Scholar
  12. [GJ90]
    Justin Graver and Ralph Johnson, “A Type System for Smalltalk.” In Conference Record of the 17th Annual ACM Symposium on Principles of Programming Languages, San Francisco, CA, January, 1990.Google Scholar
  13. [GR83]
    Adele Goldberg and David Robson, Smalltalk-80: The Language and Its Implementation. Addison-Wesley, Reading, MA, 1983.Google Scholar
  14. [Han74]
    Gilbert J. Hansen, Adaptive Systems for the Dynamic Run-Time Optimization of Programs. Ph.D. Thesis, Carnegie-Mellon University, 1974.Google Scholar
  15. [Hei90]
    Richard L. Heintz, Jr., Low Level Optimizations for an Object-Oriented Programming Language. Master's Thesis, University of Illinois at Urbana-Champaign, 1990.Google Scholar
  16. [Ing86]
    Daniel H. Ingalls, “A Simple Technique for Handling Multiple Polymorphism.” In OOPSLA '86 Conference Proceedings, Portland, OR, 1986. Published as SIGPLAN Notices 21(11), November, 1986.Google Scholar
  17. [JGZ88]
    Ralph E. Johnson, Justin O. Graver, and Lawrence W. Zurawski, “TS: An Optimizing Compiler for Smalltalk.” In OOPSLA '88 Conference Proceedings, pp. 18–26, San Diego, CA, October, 1988. Published as SIGPLAN Notices 23(11), November, 1988.Google Scholar
  18. [Joh87]
    Ralph Johnson, ed., “Workshop on Compiling and Optimizing Object-Oriented Programming Languages.” In Addendum to the OOPSLA '87 Conference Proceedings, pp. 59–65, Orlando, FL, October, 1987. Published as SIGPLAN Notices 23(5), May, 1988.Google Scholar
  19. [KiRo89]
    Gregor Kiczales and Luis Rodriguez, “Efficient Method Dispatch in PCL.” Technical Report SSL-89-95, Xerox PARC, 1989.Google Scholar
  20. [Kra83]
    Glenn Krasner, ed., Smalltalk-80: Bits of History and Words of Advice. Addison-Wesley, Reading, MA, 1983.Google Scholar
  21. [Lea90]
    Douglas Lea, “Customization in C++.” In Proceedings of the 1990 Usenix C++ Conference, pp. 301–314, San Francisco, CA, April, 1990.Google Scholar
  22. [MIPS86]
    MIPS Computer Systems, MIPS Language Programmer's Guide. MIPS Computer Systems, Sunnyvale, CA, 1986.Google Scholar
  23. [Mit70]
    J. G. Mitchell, Design and Construction of Flexible and Efficient Interactive Programming Systems. Ph.D. Thesis, Carnegie-Mellon University, 1970.Google Scholar
  24. [PW90]
    William Pugh and Grant Weddell, “Two-Directional Record Layout for Multiple Inheritance.” In Proceedings of the SIGPLAN '90 Conference on Programming Language Design and Implementation, pp. 85–91, White Plains, NY, June, 1990. Published as SIGPLAN Notices 25(6), June, 1990.Google Scholar
  25. [Ros88]
    John R. Rose, “Fast Dispatch Mechanisms for Stock Hardware.” In OOPSLA '88 Conference Proceedings, pp. 27–35, San Diego, CA, October, 1988. Published as SIGPLAN Notices 23(11), November, 1988.Google Scholar
  26. [ST84]
    Norihisa Suzuki and Minora Terada, “Creating Efficient Systems for Object-Oriented Languages.” In Proceedings of the 11th Symposium on the Principles of Programming Languages, Salt Lake City, January, 1984.Google Scholar
  27. [Suz81]
    Norihisa Suzuki, “Inferring Types in Smalltalk.” In Proceedings of the 8th Symposium on the Principles of Programming Languages, 1981.Google Scholar
  28. [UBF+84]
    D. Ungar, R. Blau, P. Foley, D. Samples, and D. Patterson, “Architecture of SOAR: Smalltalk on a RISC.” In Eleventh Annual International Symposium on Computer Architecture, Ann Arbor, MI, June, 1984.Google Scholar
  29. [Ung86]
    David Ungar, The Design and Evaluation of a High Performance Smalltalk System. MIT Press, Cambridge, MA, 1986.Google Scholar
  30. [UP83]
    David Ungar and David Patterson, “Berkeley Smalltalk: Who Knows Where the Time Goes?” In [Kra83].Google Scholar
  31. [UP87]
    David Ungar and David Patterson, “What Price Smalltalk?” In IEEE Computer 20(1), January, 1987.Google Scholar
  32. [WM89]
    Paul R. Wilson and Thomas G. Mohler, “Design of the Opportunistic Garbage Collector.” In OOPSLA '89 Conference Proceedings, pp. 23–35, New Orleans, LA, October, 1989. Published as SIGPLAN Notices 24(10), October. 1989.Google Scholar

Copyright information

© Springer-Verlag 1991

Authors and Affiliations

  1. 1.Computer Systems LaboratoryStanford UniversityStanford

Personalised recommendations