Coloring, a versatile technique for implementing object-oriented languages

被引:6
|
作者
Ducournau, Roland [1 ,2 ]
机构
[1] Univ Montpellier 2, LIRMM, F-34000 Montpellier, France
[2] CNRS, F-34000 Montpellier, France
来源
SOFTWARE-PRACTICE & EXPERIENCE | 2011年 / 41卷 / 06期
关键词
object-oriented programming; multiple inheritance; late binding; object layout; subtype testing; virtual function tables; LAYOUT; TESTS; DISPATCH;
D O I
10.1002/spe.1022
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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 (C) 2010 John Wiley & Sons, Ltd.
引用
收藏
页码:627 / 659
页数:33
相关论文
共 50 条
  • [1] Implementing Partial Persistence in Object-Oriented Languages
    Pluquet, Frederic
    Langerman, Stefan
    Marot, Antoine
    Wuyts, Roel
    [J]. PROCEEDINGS OF THE TENTH WORKSHOP ON ALGORITHM ENGINEERING AND EXPERIMENTS AND THE FIFTH WORKSHOP ON ANALYTIC ALGORITHMICS AND COMBINATORICS, 2008, : 37 - +
  • [2] Implementing Statically Typed Object-Oriented Programming Languages
    Ducournau, Roland
    [J]. ACM COMPUTING SURVEYS, 2011, 43 (03)
  • [3] FOUNDATIONS OF OBJECT-ORIENTED LANGUAGES
    BLACK, A
    PALSBERG, J
    [J]. SIGPLAN NOTICES, 1994, 29 (03): : 3 - 11
  • [4] EXCEPTIONS IN OBJECT-ORIENTED LANGUAGES
    BORGIDA, A
    [J]. SIGPLAN NOTICES, 1986, 21 (10): : 107 - 119
  • [5] THE FUTURE OF OBJECT-ORIENTED LANGUAGES
    ANDERSON, J
    SUZUKI, N
    BORNING, A
    STEFIK, M
    THOMAS, D
    LIEBERMAN, H
    [J]. SIGPLAN NOTICES, 1986, 21 (11): : 507 - 507
  • [6] OBJECT-ORIENTED LANGUAGES FOR THE MACINTOSH
    SCHMUCKER, KJ
    [J]. BYTE, 1986, 11 (08): : 177 - &
  • [7] COMPARING OBJECT-ORIENTED LANGUAGES
    WARREN, RL
    [J]. DR DOBBS JOURNAL, 1994, 19 (03): : 10 - 10
  • [8] Foundations of object-oriented languages
    Bruce, K
    Remy, D
    [J]. INFORMATION AND COMPUTATION, 2002, 172 (01) : 1 - 1
  • [9] COMPARING OBJECT-ORIENTED LANGUAGES
    FLOYD, M
    [J]. DR DOBBS JOURNAL, 1993, 18 (10): : 104 - &
  • [10] Constrained Types for Object-Oriented Languages
    Nystrom, Nathaniel
    Saraswat, Vijay
    Palsberg, Jens
    Grothoff, Christian
    [J]. ACM SIGPLAN NOTICES, 2008, 43 (10) : 457 - 474