Abstract
C++ object layout schemes rely on (sometimes numerous) compiler generated fields. We describe a new language-independent object layout scheme, which is space optimal, i.e., objects are contiguous, and contain no compiler generated fields other than a single type identifier. As in C++ and other multiple inheritance languages such as Cecil and Dylan, the new scheme sometimes requires extra levels of indirection to access some of the fields. Using a data set of 28 hierarchies, totaling almost 50,000 types, we show that the new scheme improves field access efficiency over standard implementations, and competes favorably with (the non-space optimal) highly optimized C++ specific implementations. The benchmark includes a new analytical model for computing the frequency of indirections in a sequence of field access operations. Our layout scheme relies on whole-program analysis, which requires about 10 micro-seconds per type on a contemporary architecture (Pentium III, 900Mhz, 256MB machine), even in very large hierarchies.
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
Cargill, T., Cox, B., Cook, W., Loomis, M., Snyder, A.: Is multiple inheritance essential to OOP? In: Panel discussion at the Eighth Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA 1995), Washington, DC (October 1993)
Chambers, C.: The Cecil language, specification and rationale. Technical Report TR-93-03-05, University of Washington, Seattle (1993)
Dixon, R., McKee, T., Vaughan, M., Schweizer, P.: A fast method dispatcher for compiled languages with multiple inheritance. In: Proceedings of the 4th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 1989, ACM SIGPLAN Notices, New Orleans, Louisian, October 1989, vol. 24(10), pp. 211–214 (1989)
Eckel, N., Gil, J.Y.: Empirical study of object-layout strategies and optimization techniques. In: Bertino, E. (ed.) ECOOP 2000. LNCS, vol. 1850, pp. 394–421. Springer, Heidelberg (2000)
Gil, J.Y., Sweeney, P.: Space-and time-efficient memory layout for multiple inheritance. In: Proceedings of the 14th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 1999, ACM SIGPLAN Notices, Denver, Colorado, November 1999, vol. 34(10), pp. 256–275 (1999)
Lippman, S.B.: Inside The C++ Object Model, 2nd edn. Addison-Wesley, Reading (1996)
Magnussun, B., Meyer, B., et al.: Who needs need multiple inheritance. In: Panel discussion at the European conference on Technology of Object Oriented Programming (TOOLS Europe 1994) (March 1994)
Moon, D.A.: Object-oriented programming with flavors. In: Proceedings of the 1st Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 1986, ACM SIGPLAN Notices, Portland, Oregon, USA, September 29-October 2, vol. 21(11), pp. 1–8 (1986)
Pugh, W., Weddell, G.: Two-directional record layout for multiple inheritance. In: Proceedings of the ACM SIGPLAN’90 Conference on Programming Language Design and Implementation (PLDI), ACM SIGPLAN, SIGPLAN Notices, White Plains, New York, vol. 25(6), pp. 85–91. ACM Press, New York (1990)
Pugh, W., Weddell, G.: On object layout for multiple inheritance. Technical Report CS-93-22, University of Waterloo—Department of Computer Science (May 1993)
Royer, A.: Optimizing Method Search with Lookup Caches and Incremental Coloring. In: Proceedings of the 7th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 1992, ACM SIGPLAN Notices, Vancouver, British Columbia, Canada, October 18-22, vol. 27(10), pp. 110–126 (October 1992)
Shalit, A.: The Dylan Reference Manual: The Definitive Guide to the New Object- Oriented Dynamic Language. Addison-Wesley, Reading (1997)
Stroustrup, B.: The Design and Evolution of C++. Addison-Wesley, Reading (1994)
Stroustrup, B.: The C++ Programming Language, 3rd edn. Addison-Wesley, Reading (1997)
Trotter, W.T.: Combinatorics and Partially Ordered Sets: Dimension Theory. The Johns Hopkins University Press (1992)
Zendra, O., Colnet, C., Collin, S.: Efficient dynamic dispatch without virtual function tables: The SmallEiffel compiler. In: Proceedings of the 12th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 1997, ACM SIGPLAN Notices, Atlanta, Georgia, October 5-9, pp. 125–141 (1997)
Zibin, Y., Gil, J.Y.: Efficient subtyping tests with PQ-encoding. In: Proceedings of the 16th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 2001, ACM SIGPLAN Notices, Tampa Bay, Florida, October 14–18, vol. 36(10), pp. 96–107 (2001)
Zibin, Y., Gil, J.Y.: Fast algorithm for creating space efficient dispatching tables with application to multi-dispatching. In: Proceedings of the 17th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 2002, ACM SIGPLAN Notices, Seattle, Washington, November 4–8, vol. 37(10), pp. 142–160 (2002)
Zibin, Y., Gil, J.Y.: Incremental algorithms for dispatching in dynamically typed languages. In: Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages (POPL 2003), pp. 126–138. ACM Press, New York (2003)
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
Zibin, Y., Gil, J.(. (2003). Two-Dimensional Bi-directional Object Layout. In: Cardelli, L. (eds) ECOOP 2003 – Object-Oriented Programming. ECOOP 2003. Lecture Notes in Computer Science, vol 2743. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45070-2_15
Download citation
DOI: https://doi.org/10.1007/978-3-540-45070-2_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40531-3
Online ISBN: 978-3-540-45070-2
eBook Packages: Springer Book Archive