Fast subtype checking in the HotSpot JVM

  • Authors:
  • Cliff Click;John Rose

  • Affiliations:
  • Sun Microsystems, Santa Clara, CA;Sun Microsystems, Santa Clara, CA

  • Venue:
  • JGI '02 Proceedings of the 2002 joint ACM-ISCOPE conference on Java Grande
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present the fast subtype checking implemented in Sun's HotSpot JVM. Subtype checks occur when a program wishes to know if class S implements class T, where S and T are not both known at compile-time. Large Java programs will make millions or even billions of such checks, hence a fast check is essential. In actual benchmark runs our technique performs complete subtype checks in 3 instructions (and only 1 memory reference) essentially all the time. In rare instances it reverts to a slower array scan. Memory usage is moderate (11 words per class) and can be traded off for time. Class loading does not require recomputing any data structures associated with subtype checking.