E cient Type Inclusion Tests

A type inclusion test determines whether one type is a subtype of another. E cient type testing techniques exist for single subtyping, but not for languages with multiple subtyping. To date, the only fast constanttime technique relies on a binary matrix encoding of the subtype relation with quadratic space requirements. In this paper, we present three new encodings of the subtype relation, the packed encoding, the bit-packed encoding and the compact encoding. These encodings have di erent characteristics. The bit-packed encoding delivers the best compression rates: on average 85% for real life programs. The packed encoding performs type inclusion tests in only 4 machine instructions. We present a fast algorithm for computing these encoding which runs in less than 13 milliseconds for PE and BPE, and 23 milliseconds for CE on an Alpha processor. Finally, we compare our results with other constant-time type inclusion tests on a suite of 11 large benchmark hierarchies.

[1]  Niklaus Wirth Reply to “Type-extension tests can be performed in constant time” , 1991, TOPL.

[2]  Yves Caseau Efficient handling of multiple inheritance hierarchies , 1993, OOPSLA '93.

[3]  Karel Driesen Selector table indexing & sparse arrays , 1993, OOPSLA '93.

[4]  R. Nigel Horspool,et al.  Taming Message Passing: Efficient Method Look-Up for Dynamically Typed Languages , 1994, ECOOP.

[5]  Niklaus Wirth,et al.  Type extensions , 1988, TOPL.

[6]  Patrick Lincoln,et al.  Efficient implementation of lattice operations , 1989, TOPL.

[7]  Jan Vitek,et al.  Message Dispatch on Pipelined Processors , 1995, ECOOP.

[8]  Andreas Krall,et al.  CACAO — A 64‐bit JavaVM just‐in‐time compiler , 1997 .

[9]  Norman H. Cohen Type-extension type test can be performed in constant time , 1991, TOPL.

[10]  Lhouari Nourine,et al.  Tree Structure for Distributive Lattices and its Applications , 1996, Theor. Comput. Sci..

[11]  R. Nigel Horspool,et al.  Compact Dispatch Tables for Dynamically Typed Object Oriented Languages , 1996, CC.

[12]  Peter Dencker,et al.  Optimization of parser tables for portable compilers , 1984, TOPL.

[13]  R. Nigel Horspool,et al.  Near Optimal Hierarchical Encoding of Types , 1997, ECOOP.

[14]  E. Dijkstra,et al.  Recursive Programming , 1960 .

[15]  David Grove,et al.  Vortex: an optimizing compiler for object-oriented languages , 1996, OOPSLA '96.

[16]  Christian Queinnec Fast and Compact Dispatching for Dynamic Object-Oriented Languages , 1997, Inf. Process. Lett..