Efficient first-class generics on stock Java virtual machines

  • Authors:
  • James Sasitorn;Robert Cartwright

  • Affiliations:
  • Rice University, Houston TX;Rice University, Houston TX

  • Venue:
  • Proceedings of the 2006 ACM symposium on Applied computing
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

The second-class formulation of generics in Java 5.0 discards generic type information during compilation. As a result, Java 5.0 prohibits run-time type-dependent operations, generates unavoidable unchecked warnings (type errors) during compilation, and causes unexpected behavior during execution. The NEXTGEN Generic Java compiler eliminates these pathologies by retaining parametric type information at runtime and customizing the code in generic classes and polymorphic methods where necessary to support (parametric) type-dependent operations. NEXTGEN is a production compiler for the entire Java 5.0 language; it executes on standard JVMs and is backward compatible with existing libraries and other binaries. Benchmarks show that the first-class implementation of generic types in NEXTGEN has essentially the same performance as Java 5.0 and significanlty outperforms alternative first-class implementation architectures.