Premium
Coloring, a versatile technique for implementing object‐oriented languages
Author(s) -
Ducournau Roland
Publication year - 2011
Publication title -
software: practice and experience
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.437
H-Index - 70
eISSN - 1097-024X
pISSN - 0038-0644
DOI - 10.1002/spe.1022
Subject(s) - computer science , heuristics , inheritance (genetic algorithm) , multiple inheritance , compiler , programming language , overhead (engineering) , compile time , object (grammar) , parallel computing , object oriented programming , theoretical computer science , operating system , artificial intelligence , gene , biochemistry , chemistry
Late binding and subtyping create run‐time overhead for object‐oriented languages. Dynamic typing and multiple inheritance create even more overhead. Static typing and single inheritance lead to two major invariants, of reference and position, that make the implementation as efficient as possible. Coloring is a technique that preserves these invariants for dynamic typing or multiple inheritance at minimal spatial cost. Coloring has been independently proposed for method invocation under the name of selector coloring , for subtype tests under the name of pack encoding , and for attribute access and object layout. This paper reviews a number of uses of coloring for optimizing object‐oriented programming, generalizes them, and specifies several variations, such as bidirectional and n ‐directional coloring. Coloring is NP‐hard, hence compilers that use it depend on heuristics. The paper describes two families of heuristics and presents some experimental results which indicate that coloring is both efficient and tractable and that bidirectional coloring gives the best results. Copyright © 2010 John Wiley & Sons, Ltd.