Skip Navigation

The Computer Journal 2003 46(3):263-294; doi:10.1093/comjnl/46.3.263
© 2003 by British Computer Society
This Article
Right arrow Full Text (PDF)
Right arrow Alert me when this article is cited
Right arrow Alert me if a correction is posted
Services
Right arrow Email this article to a friend
Right arrow Similar articles in this journal
Right arrow Similar articles in ISI Web of Science
Right arrow Alert me to new issues of the journal
Right arrow Add to My Personal Archive
Right arrow Download to citation manager
Right arrow Search for citing articles in:
ISI Web of Science (1)
Right arrowRequest Permissions
Google Scholar
Right arrow Articles by Viroli, M.
Right arrow Search for Related Content
Social Bookmarking
 Add to CiteULike   Add to Connotea   Add to Del.icio.us  
What's this?

A Type-Passing Approach for the Implementation of Parametric Methods in Java

Mirko Viroli1

1 DEIS, Università di Bologna, via Rasi e Spinelli 176, 47023 Cesena (FC), Italy Email: mviroli@deis.unibo.it

Parametric methods are recognized as a very useful tool for reusing code and augmenting the expressiveness of an object-oriented language providing parametric classes. his paper focuses on their implementation techniques for Java. Existing proposals for extending Java with parametric polymorphism are outlined, showing and discussing the basic implementation techniques: type-erasure, code-expansion and type-passing. Up until now, only type-erasure and code-expansion have been exploited for the implementation of parametric methods, but they suffer from some problems. Basically, type-erasure is unable to support parametric types at run-time, while code-expansion generally leads to significant increase of both disk and memory overhead. The main goal of this paper is to study a type-passing approach aimed at tackling these issues. This is based on the management of method descriptors, which are objects passed to the method bodies at invocation-time, and which carry information on the instantiation of the method's type parameters. Run-time efficiency is guaranteed thanks to a special treatment of descriptors deferring their creation at load-time. Dynamic dispatching of method calls is supported by exploiting a data structure called the Virtual Parametric Methods Table, resembling Virtual Methods Tables of C++. The approach here presented turns out to be a significant alternative to the existing proposals for implementing generics in Java, supporting parametric types at run-time without unnecessary code footprint.


Add to CiteULike CiteULike   Add to Connotea Connotea   Add to Del.icio.us Del.icio.us    What's this?




Disclaimer:
Please note that abstracts for content published before 1996 were created through digital scanning and may therefore not exactly replicate the text of the original print issues. All efforts have been made to ensure accuracy, but the Publisher will not be held responsible for any remaining inaccuracies. If you require any further clarification, please contact our Customer Services Department.