JINDY: a Java library to support invokedynamic

Patricia Conde1 and Francisco Ortin1

  1. University of Oviedo, Computer Science Department
    Calvo Sotelo s/n, 33007, Oviedo, Spain
    {condepatricia, ortin}@uniovi.es


Java 7 has included the new invokedynamic opcode in the Java virtual machine. This new instruction allows the user to define method linkage at runtime. Once the link is established, the virtual machine performs its common optimizations, providing better runtime performance than reflection. However, this feature has not been offered at the abstraction level of the Java programming language. Since the functionality of the new opcode is not provided as a library, the existing languages in the Java platform can only use it at the assembly level. For this reason, we have developed the JINDY library that offers invokedynamic to any programming language in the Java platform. JINDY supports three modes of use, establishing a trade-off between runtime performance and flexibility. A runtime performance and memory consumption evaluation is presented. We analyze the efficiency of JINDY compared to reflection, the MethodHandle class in Java 7 and the Dynalink library. The memory and performance costs compared to the invokedynamic opcode are also measured.

Key words

invokedynamic, Java Virtual Machine, dynamically generated classes, reflection, runtime performance

Digital Object Identifier (DOI)


Publication information

Volume 11, Issue 1 (January 2014)
Year of Publication: 2014
ISSN: 1820-0214 (Print) 2406-1018 (Online)
Publisher: ComSIS Consortium

Full text

DownloadAvailable in PDF
Portable Document Format

How to cite

Conde, P., Ortin, F.: JINDY: a Java library to support invokedynamic. Computer Science and Information Systems, Vol. 11, No. 1, 47-68. (2014), https://doi.org/10.2298/CSIS130129018C