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.
This work has been supported in part by the Swiss National Science Foundation (Nationalfonds), an IBM graduate student fellowship, NSF Presidential Young Investigator Grant # CCR-8657631 and by Sun, IBM, Apple, Cray, Tandem, TI, and DEC.
Preview
Unable to display preview. Download preview PDF.
References
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.
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.
Thomas J. Conroy and Eduardo Pelegri-Llopart, “An Assessment of Method-Lookup Caches for Smalltalk-80 Implementations.” In [Kra83].
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.
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.
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.
Craig Chambers and David Ungar, “Making Pure Object-Oriented Languages Practical.” To be presented at OOPSLA '91, Phoenix, AZ, October, 1991.
L. Peter Deutsch, “The Dorado Smalltalk-80 Implementation: Hardware Architecture's Impact on Software Architecture.” In [Kra83].
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.
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.
Margaret A. Ellis and Bjame Stroustrup, The Annotated C++ Reference Manual. Addison-Wesley, Reading, MA, 1990.
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.
Adele Goldberg and David Robson, Smalltalk-80: The Language and Its Implementation. Addison-Wesley, Reading, MA, 1983.
Gilbert J. Hansen, Adaptive Systems for the Dynamic Run-Time Optimization of Programs. Ph.D. Thesis, Carnegie-Mellon University, 1974.
Richard L. Heintz, Jr., Low Level Optimizations for an Object-Oriented Programming Language. Master's Thesis, University of Illinois at Urbana-Champaign, 1990.
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.
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.
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.
Gregor Kiczales and Luis Rodriguez, “Efficient Method Dispatch in PCL.” Technical Report SSL-89-95, Xerox PARC, 1989.
Glenn Krasner, ed., Smalltalk-80: Bits of History and Words of Advice. Addison-Wesley, Reading, MA, 1983.
Douglas Lea, “Customization in C++.” In Proceedings of the 1990 Usenix C++ Conference, pp. 301–314, San Francisco, CA, April, 1990.
MIPS Computer Systems, MIPS Language Programmer's Guide. MIPS Computer Systems, Sunnyvale, CA, 1986.
J. G. Mitchell, Design and Construction of Flexible and Efficient Interactive Programming Systems. Ph.D. Thesis, Carnegie-Mellon University, 1970.
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.
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.
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.
Norihisa Suzuki, “Inferring Types in Smalltalk.” In Proceedings of the 8th Symposium on the Principles of Programming Languages, 1981.
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.
David Ungar, The Design and Evaluation of a High Performance Smalltalk System. MIT Press, Cambridge, MA, 1986.
David Ungar and David Patterson, “Berkeley Smalltalk: Who Knows Where the Time Goes?” In [Kra83].
David Ungar and David Patterson, “What Price Smalltalk?” In IEEE Computer 20(1), January, 1987.
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.
Author information
Authors and Affiliations
Corresponding author
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hölzle, U., Chambers, C., Ungar, D. (1991). Optimizing dynamically-typed object-oriented languages with polymorphic inline caches. In: America, P. (eds) ECOOP'91 European Conference on Object-Oriented Programming. ECOOP 1991. Lecture Notes in Computer Science, vol 512. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0057013
Download citation
DOI: https://doi.org/10.1007/BFb0057013
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-54262-9
Online ISBN: 978-3-540-47537-8
eBook Packages: Springer Book Archive