Optimizing invokedynamic

  • Authors:
  • Christian Thalinger;John Rose

  • Affiliations:
  • Oracle Corporation;Oracle Corporation

  • Venue:
  • Proceedings of the 8th International Conference on the Principles and Practice of Programming in Java
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

In order to support the needs of non-Java languages, the JSR 292 Expert Group has designed a new bytecode "invokedynamic" which allows JVM bytecodes to contain call sites with pluggable, user-defined behavior. The bytecode is accompanied by a new data type called a "method handle" that reifies the pluggable behavior, in the form of a functional value. The authors have been building the JSR 292 Reference Implementation on top of Oracle's HotSpot JVM. This paper describes their implementation tactics. Interesting subtopics include connecting the novel features of JSR 292 to classic HotSpot optimizations, creating new code optimization techniques for HotSpot in support of JSR 292, using Java (along with HotSpot's customary C++) as an implementation language for method handles, using internally-generated bytecodes as an intermediate language for "freezing" dynamic call sites before optimization, and designing specialized "adapter" calling sequences which match callers and callees of differing type descriptors.