Iterative type analysis and extended message splitting; optimizing dynamically-typed object-oriented programs
- 1 June 1990
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 25 (6) , 150-164
- https://doi.org/10.1145/93548.93562
Abstract
Object-oriented languages have suffered from poor performance caused by frequent and slow dynamically-bound procedure calls. The best way to speed up a procedure call is to compile it out, but dynamic binding of object-oriented procedure calls without static receiver type information precludes inlining. Iterative type analysis and extended message splitting are new compilation techniques that extract much of the necessary type information and make it possible to hoist run-time type tests out of loops. Our system compiles code on-the-fly that is customized to the actual data types used by a running program. The compiler constructs a control flow graph annotated with type information by simultaneously performing type analysis and inlining. Extended message splitting preserves type information that would otherwise be lost by a control-flow merge by duplicating all the code between the merge and the place that uses the information. Iterative type analysis computes the types of variables used in a loop by repeatedly recompiling the loop until the computed types reach a fix-point. Together these two techniques enable our SELF compiler to split off a copy of an entire loop, optimized for the common-case types. By the time our SELF compiler generates code for the graph, it has eliminated many dynamically-dispatched procedure calls and type tests. The resulting machine code is twice as fast as that generated by the previous SELF compiler, four times faster than ParcPlace Systems Smalltalk-80, * the fastest commercially available dynamically-typed object-oriented language implementation, and nearly half the speed of optimized C. Iterative type analysis and extended message splitting have cut the performance penalty for dynamically-typed object-oriented languages in half.This publication has 10 references indexed in Scilit:
- A type system for SmalltalkPublished by Association for Computing Machinery (ACM) ,1990
- An efficient implementation of SELF a dynamically-typed object-oriented language based on prototypesPublished by Association for Computing Machinery (ACM) ,1989
- Static type inference for parametric classesPublished by Association for Computing Machinery (ACM) ,1989
- Customization: optimizing compiler technology for SELF, a dynamically-typed object-oriented programming languagePublished by Association for Computing Machinery (ACM) ,1989
- A bibliography on partial evaluationACM SIGPLAN Notices, 1988
- TS: an optimizing compiler for smalltalkPublished by Association for Computing Machinery (ACM) ,1988
- Self: The power of simplicityPublished by Association for Computing Machinery (ACM) ,1987
- Advanced compiler optimizations for supercomputersCommunications of the ACM, 1986
- Type-checking SmalltalkPublished by Association for Computing Machinery (ACM) ,1986
- Efficient implementation of the smalltalk-80 systemPublished by Association for Computing Machinery (ACM) ,1984