Advertisement

Two-Dimensional Bi-directional Object Layout

  • Yoav Zibin
  • Joseph (Yossi) Gil
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2743)

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.

Keywords

Runtime System Layout Scheme Layout Algorithm Memory Overhead Type Hierarchy 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    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)Google Scholar
  2. 2.
    Chambers, C.: The Cecil language, specification and rationale. Technical Report TR-93-03-05, University of Washington, Seattle (1993)Google Scholar
  3. 3.
    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)Google Scholar
  4. 4.
    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)CrossRefGoogle Scholar
  5. 5.
    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)Google Scholar
  6. 6.
    Lippman, S.B.: Inside The C++ Object Model, 2nd edn. Addison-Wesley, Reading (1996)Google Scholar
  7. 7.
    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)Google Scholar
  8. 8.
    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)Google Scholar
  9. 9.
    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)Google Scholar
  10. 10.
    Pugh, W., Weddell, G.: On object layout for multiple inheritance. Technical Report CS-93-22, University of Waterloo—Department of Computer Science (May 1993)Google Scholar
  11. 11.
    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)Google Scholar
  12. 12.
    Shalit, A.: The Dylan Reference Manual: The Definitive Guide to the New Object- Oriented Dynamic Language. Addison-Wesley, Reading (1997)Google Scholar
  13. 13.
    Stroustrup, B.: The Design and Evolution of C++. Addison-Wesley, Reading (1994)Google Scholar
  14. 14.
    Stroustrup, B.: The C++ Programming Language, 3rd edn. Addison-Wesley, Reading (1997)Google Scholar
  15. 15.
    Trotter, W.T.: Combinatorics and Partially Ordered Sets: Dimension Theory. The Johns Hopkins University Press (1992)Google Scholar
  16. 16.
    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)Google Scholar
  17. 17.
    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)Google Scholar
  18. 18.
    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)Google Scholar
  19. 19.
    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)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Yoav Zibin
    • 1
  • Joseph (Yossi) Gil
    • 1
  1. 1.Israel Institute of TechnologyTechnion 

Personalised recommendations