Multi-dispatch in the Java virtual machine: design and implementation

  • Authors:
  • Christopher Dutchyn;Paul Lu;Duane Szafron;Steven Bromling;Wade Holst

  • Affiliations:
  • Dept. of Computing Science, University of Alberta, Edmonton, Alberta, Canada;Dept. of Computing Science, University of Alberta, Edmonton, Alberta, Canada;Dept. of Computing Science, University of Alberta, Edmonton, Alberta, Canada;Dept. of Computing Science, University of Alberta, Edmonton, Alberta, Canada;Dept. of Computer Science, The University of Western Ontario, London, Ontario, Canada

  • Venue:
  • COOTS'01 Proceedings of the 6th conference on USENIX Conference on Object-Oriented Technologies and Systems - Volume 6
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

Mainstream object-oriented languages, such as C++ and Java, provide only a restricted form of polymorphic methods, namely uni-receiver dispatch. In common programming situations, developers must work around this limitation. We describe how to extend the Java Virtual Machine to support multi-dispatch and examine the complications that Java imposes on multidispatch in practice. Our technique avoids changes to the Java programming language itself, maintains source code and library compatibility, and isolates the performance penalty and semantic changes of multimethod dispatch to the program sections which use it. We have micro-benchmark and application-level performance results for a dynamic Most Specific Applicable (MSA) dispatcher, a framework-based Single Receiver Projections (SRP) dispatcher, and a tuned SRP dispatcher. Our general-purpose technique provides smaller dispatch latency than programmer-written double-dispatch code with equivalent functionality.