scispace - formally typeset
Search or ask a question

Showing papers on "Multiple dispatch published in 2012"


Patent
Yuki Makino1, Mikio Takeuchi1
08 Aug 2012
TL;DR: In this article, a reified generic system is presented for translating a first language program to a second language, which includes a processor to translate the program from the first language to the second language.
Abstract: A system processes a reified generic. The system includes a memory device to store programming code in a first language, the programming code including a definition and an invocation of an interface method. The system also includes a processor to translate the programming code from the first language to a second language, generate a definition of a general dispatch method, generate definitions of special dispatch methods, each of the special dispatch methods corresponding to each primitive return type of the interface method, and generate an invocation of either the general dispatch method or one of the special dispatch methods based on a return type of the interface method.

1 citations


Journal ArticleDOI
TL;DR: This paper proposes a space efficient non-constant time technique (each method address should be computed - rather than being looked up) for multi-method dispatch with single inheritance type hierarchies and found to offer dispatch time similar to existing techniques.
Abstract: Multi-method dispatch in object oriented programs provides additional expressibility, readability and elegance over single dispatch languages. Optimizing multi-method dispatch is a central issue in compilers that support multi-methods. Existing constant time dispatch techniques for multi-methods keep either a lookup table or a lookup tree after compressing the same, the size of which can still be large if compression is not effective. In this paper, we propose a space efficient non-constant time technique (each method address should be computed - rather than being looked up) for multi-method dispatch with single inheritance type hierarchies. The method table containing all the multi-method signatures is the only data structure kept at run time. The table is arranged by sorting on argument position to expedite method search during dispatch. Heuristics is used during method search such that those methods which are not potential candidates are not included in the search. The proposed technique saves space significantly while the dispatch time grew higher compared to existing techniques. When multi-method counts were within practical bounds, the proposed technique was found to offer dispatch time similar to existing techniques.

1 citations