Abstract
Object-oriented programming encourages the use of small functions, dynamic dispatch (virtual functions), and inheritance for code reuse. As a result, such programs typically suffer from inferior performance. The problem is that polymorphic functions do not know the exact types of the data they operate on, and hence must use indirection to operate on them. However, most polymorphism is parametric (e.g. templates in C++) which is amenable to elimination through code replication. We present a cloning algorithm which eliminates parametric polymorphism while minimizing code duplication. The effectiveness of this algorithm is demonstrated on a number of concurrent object-oriented programs. Finally, since functions and data structures can be parameterized over properties other than type, this algorithm is applicable to general forward data flow problems.
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
O. Agesen, J. Palsberg, and M. Schwartzbach. Type inference of Self: Analysis of objects with dynamic and multiple inheritance. In Proceedings of ECOOP '93, 1993.
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, Computer Science Department, University of California, Santa Barbara, 1995.
Apple Computer, Inc., Cupertino, California. Object Pascal User's Manual, 1988.
Brad Calder and Dirk Grunwald. Reducing indirect function call overhead in C++ programs. In Twenty-first Symposium on Principles of Programming Languages, pages 397–408. ACM SIGPLAN, 1994.
Brad Calder, Dirk Grunwald, and Benjamin Zorn. Quantifying differences between C and C++ programs. Technical Report CU-CS-698-94, University of Colorado, Boulder, January 1994.
C. Chambers and D. Ungar. Customization: Optimizing compiler technology for Self, a dynamically-typed object-oriented programming language. In Proceedings of SIGPLAN Conference on Programming Language Design and Implementation, pages 146–60, 1989.
C. Chambers and D. Ungar. Iterative type analysis and extended message splitting. In Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation, pages 150–60, 1990.
Craig Chambers. The Design and Implementation of the Self Compiler, an Optimizing Compiler for Object-Oriented Programming Languages. PhD thesis, Stanford University, Stanford, CA, March 1992.
Craig Chambers. The Cecil language: Specification and rationale. Technical Report TR 93-03-05, Department of Computer Science and Engineering, University of Washington, Seattle, Washington, March 1993.
Andrew A. Chien. Concurrent Aggregates: Supporting Modularity in Massively-Parallel Programs. MIT Press, Cambridge, MA, 1993.
Andrew A. Chien, Vijay Karamcheti, John Plevyak, and Xingbin Zhang. Concurrent aggregates language report 2.0. Available via anonymous ftp from cs.uiuc.edu in /pub/csag or from http://www-csag.cs.uiuc.edu/, September 1993.
K. Cooper, K. Kennedy, and L. Torczon. The impact of interprocedural analysis and optimization in the Rn environment. ACM Transactions on Programming Languages and Systems, 8(4):491–523, October 1986.
K. D. Cooper, M. W. Hall, and K. Kennedy. Procedure cloning. In Proceedings of the IEEE Computer Society 1992 International Conference on Computer Languages, pages 96–105, April 1992.
K. D. Cooper, M. W. Hall, and K. Kennedy. A methodology for procedure cloning. Computer Languages, 19(2):105–118, April 1993.
Cray Research, Inc., Eagan, Minnesota 55121. CRAY T3D Software Overview Technical Note, 1992.
Jeffrey Dean, Craig Chambers, and David Grove. Identifying profitable specialization in objectoriented languages. Technical Report TR 94-02-05, Department of Computer Science and Engineering, University of Washington, Seattle, Washington, February 1994.
L. Peter Deutsch and Allan M. Schiffman. Efficient implementation of the smalltalk-80 system. In Eleventh Symposium on Principles of Programming Languages, pages 297–302. ACM, 1984.
The Concurrent Systems Architecture Group. The ICC++ reference manual, version 1.0. Technical report, University of Illinois, Department of Computer Science, 1304 W. Springfield Avenue, Urbana, Illinois, 1995. Also available from http://www-csag.cs.uiuc.edu/.
M. W. Hall. Managing Interprocedural Optimization. PhD thesis, Rice University, 1991.
M. W. Hall, S. Hiranandani, and K. Kennedy. Interprocedural compilation of Fortran D for MIMD distributed memory machines. In Supercomputing '92, pages 522–535, 1992.
Mary W. Hall, Ken Kennedy, and Kathryn S. McKinley. Interprocedural transformations for parallel code generation. In Proceedings of the 4th Annual Conference on High-Performance Computing (Supercomputing '91), pages 424–434, November 1991.
Mary W. Hall, John M. Mellor-Crummey, Alan Clarle, and René G. Rodríguez. FIAT: A framework for interprocedural analysis and transformation. In Proceedings of the Sixth Workshop for Languages and Compilers for Parallel Machines, pages 522–545, August 1993.
Urs Hölzle, Craig Charmbers, and David Ungar. Optimizing dynamically-typed object-oriented languages iwth polymorphic inline caches. In ECOOP'91 Conference Proceedings. Springer-Verlag, 1991. Lecture Notes in Computer Science 512.
Urs Hölzle and David Ungar. Optimizing dynamically-dispatched calls with run-time type feedback. In Proceedings of the 1994 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 326–336, June 1994.
Suresh Jagannathan and Stephen Weeks. A unified treatment of flow analysis in higher-order languages. In Twenty-second Symposium on Principles of Programming Languages, pages 393–407. ACM SIGPLAN, 1995.
N. Oxhøj, J. Palsberg, and M. Schwartzbach. Making type inference practical. In Proceedings of OOPSLA '92, 1992.
J. Palsberg and M. Schwartzbach. Object-oriented type inference. In Proceedings of OOPSLA '91, pages 146–61, 1991.
John Plevyak and Andrew A. Chien. Precise concrete type inference of object-oriented programs. In Proceedings of OOPSLA, 1994.
John Plevyak, Vijay Karamcheti, Xingbin Zhang, and Andrew Chien. A hybrid execution model for fine-grained languages on distributed memory multicomputer. In Proceedings of Supercomputing '95, 1995.
John Plevyak, Xingbin Zhang, and Andrew A. Chien. Obtaining sequential efficiency in concurrent object-oriented programs. In Proceedings of the ACM Symposium on the Principles of Programming Languages, pages 311–321, January 1995.
Olin Shivers. Topics in Advanced Language Implementation, chapter Data-Flow Analysis and Type Recovery in Scheme, pages 47–88. MIT Press, Cambridge, MA, 1991.
Thinking Machines Corporation, 245 First Street, Cambridge, MA 02154-1264. The Connection Machine CM-5 Technical Summary, October 1991.
David Ungar and Randall B. Smith. Self: The power of simplicity. In Proceedings of OOPSLA '87, pages 227–41. ACM SIGPLAN, ACM Press, 1987.
Tim A. Wagner, Vance Maverick, Susan L. Graham, and Michael A. Harrison. Accurate static estimators for program optimization. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 85–96, Orlando, Florida USA, June 1994.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Plevyak, J., Chien, A.A. (1996). Type directed cloning for Object-Oriented programs. In: Huang, CH., Sadayappan, P., Banerjee, U., Gelernter, D., Nicolau, A., Padua, D. (eds) Languages and Compilers for Parallel Computing. LCPC 1995. Lecture Notes in Computer Science, vol 1033. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0014224
Download citation
DOI: https://doi.org/10.1007/BFb0014224
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-60765-6
Online ISBN: 978-3-540-49446-1
eBook Packages: Springer Book Archive