Abstract
Object oriented languages lead to dynamic dispatches of most method calls due to limitations on static analysis which have significant run-time overheads. In this work, we propose a new optimization to cut this overhead which is based on the following key observation: run-time type testing of a method at every call-site is extraneous. The technique makes use of an important observation: most of the times a polymorphic object, although statically unknown in type, is fixed at run-time and never mutates. In such cases, run-time type testing for its methods is only needed when an object is instantiated. The type check is hoisted at the entry point of a region and its results are shared over all dispatches that lie within the region. We implemented this optimization in Vortex, an optimizing object-oriented compiler back-end, and with our framework, we observed an average speed-up of 9.22%. We avoided 91% of the dynamic dispatches with a speed-up of 17.9% in the best case.
This research is partially supported by NSF under grant # CCR 9696129
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Dean, J., DeFouw, G., Grove, D., Litvinov, V., Chambers, C.: Vortex: An Optimizing Compiler for Object-Oriented Languages. In: OOPSLA 1996, 11th Conference on Object-Oriented Programming, Systems, Languages, and Applications, San Jose, CA (October 1996)
Grove, D., Dean, J., Garrett, C., Chambers, C.: Profile-Guided Receiver Class Prediction. In: OOPSLA 1995, Austin, TX (October 1995)
Hölzle, U., Chambers, C., Ungar, D.: Optimi zing Dynamically-Typed Object-Oriented Languages with Polymorphic Inline Caches. In: America, P. (ed.) ECOOP 1991. LNCS, vol. 512, pp. 21–38. Springer, Heidelberg (1991)
Deutsch, L.P., Schiffman, A.: Efficient Implement ation of the Smalltalk-80 System. In: Proceedings of the 11th. Symposium on the Principles of Programming Languages, Salt Lake City, UT (1984)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Leair, M., Pande, S. (2003). Optimizing Dynamic Dispatches through Type Invariant Region Analysis. In: Pinkston, T.M., Prasanna, V.K. (eds) High Performance Computing - HiPC 2003. HiPC 2003. Lecture Notes in Computer Science, vol 2913. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24596-4_49
Download citation
DOI: https://doi.org/10.1007/978-3-540-24596-4_49
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-20626-2
Online ISBN: 978-3-540-24596-4
eBook Packages: Springer Book Archive