Two-directional record layout for multiple inheritance
- 1 June 1990
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 25 (6) , 85-91
- https://doi.org/10.1145/93548.93556
Abstract
Much recent work in polymorphic programming languages allows subtyping and multiple inheritance for records. In such systems, we would like to extract a field from a record with the same efficiency as if we were not making use of subtyping and multiple inheritance. Methods currently used make field extraction 3-5 times slower, which can produce a significant overall performance slowdown. We describe a record layout algorithm that allows us to assign a fixed offset to each field name. This allows field extraction to done just as quickly as in systems that do not provide multiple inheritance. Assigning fixed offsets may require us to leave gaps in some records (and waste space). However, by placing fields at both positive and negative offsets we can drastically reduce the amount of wasted space. Finding an optimal layout is NP-hard, so we propose and analyze heuristic algorithms for producing good two-direction record layouts. In a trial run, our algorithm produced a fixed layout for the instance variables of the 563 flavors of a Lisp Flavors system; this fixed layout only wastes 6% of the total space consumed by a collection of one instance of each flavor.This publication has 11 references indexed in Scilit:
- An object addressing mechanism for statically typed languages with multiple inheritancePublished by Association for Computing Machinery (ACM) ,1989
- A fast method dispatcher for compiled languages with multiple inheritancePublished by Association for Computing Machinery (ACM) ,1989
- Fast dispatch mechanisms for stock hardwarePublished by Association for Computing Machinery (ACM) ,1988
- IDL: sharing intermediate representationsACM Transactions on Programming Languages and Systems, 1987
- On understanding types, data abstraction, and polymorphismACM Computing Surveys, 1985
- GALILEO: a strongly-typed, interactive conceptual languageACM Transactions on Database Systems, 1985
- Multiple inheritance in Simula-like languagesBIT Numerical Mathematics, 1985
- Implementing relational views of programsPublished by Association for Computing Machinery (ACM) ,1984
- An implementation of GEMPublished by Association for Computing Machinery (ACM) ,1984
- Extending the database relational model to capture more meaningACM Transactions on Database Systems, 1979