∟Method Invocation Instructions

This section describes JVM instructions that invoke a method identified by a constant pool entry: invoke* and *return.

What Are Method Invocation Instructions? Method invocation instructions invoke a method identified by a constant pool entry. Execution flow is transferred to the invoked method until the "return" instruction. Their mnemonics have a pattern of invoke* or *return.

The table below describes method invocation instructions. P. is the count of bytes following the opcode as operation parameters. I. is the count elements consumed from the operand stack as operation input. O. is the count elements added to the operand stack as operation output. "V" in I. and O. columns indicates that the count varies.

Mnemonic         C.  P.  I.  O.  Description
---------------  --  --  --  --  ----------------------------------------
ireturn          AC   0   1   0  Return with int
lreturn          AD   0   2   0  Return with long
freturn          AE   0   1   0  Return with float
dreturn          AF   0   2   0  Return with double
areturn          B0   0   1   0  Return with address
return           B1   0   0   0  Return with void
invokevirtual    B6   2   V   V  Invoke given virtual method
invokespecial    B6   2   V   V  Invoke given instant method
invokestatic     B6   2   V   V  Invoke given static method
invokeinterface  B6   4   V   V  Invoke given interface method
invokedynamic    B6   4   V   V  Invoke given dynamic method

Note that for invoke* instructions, the first 2 parameters are used to construct an index to the constant pool for the method reference. Address of "this" object (if needed) and arguments are provided in the operand stack.

Table of Contents

 About This Book

 JVM (Java Virtual Machine) Specification

 Java HotSpot VM - JVM by Oracle/Sun

 java.lang.Runtime Class - The JVM Instance

 java.lang.System Class - The Operating System

 ClassLoader Class - Class Loaders

 Class Class - Class Reflections

 JVM Runtime Data Areas

 JVM Stack, Frame and Stack Overflow

 Thread Testing Program and Result

 CPU Impact of Multi-Thread Applications

 I/O Impact of Multi-Thread Applications

 CDS (Class Data Sharing)

 Micro Benchmark Runner and JVM Options

 Micro Benchmark Tests on "int" Operations

 Micro Benchmark Tests on "long" Operations

 Micro Benchmark Tests in JIT Compilation Mode

 Micro Benchmark Tests on "float" and "double" Operations

 OpenJ9 by Eclipse Foundation

 JRockit JVM 28.2.7 by Oracle Corporation

►JVM Bytecode and Instruction Set

 What Is JVM Bytecode

 What Is "javap" Command

 Walkthrough of "javap -c -v" Command Output

 JVM Method Frame Architecture

 What Is Constant Pool

 JVM Instruction Set

 Constant Loading Instructions

 Local Variable Array Instructions

 Shared Memory Instructions

 Arithmetic Operation Instructions

 Bitwise Operation Instructions

 Type Conversion Instructions

 Flow Control Instructions

►Method Invocation Instructions

 Miscellaneous Instructions

 JVM Assembler/Disassembler Tools

 Archived Tutorials

 References

 Index

 Full Version in PDF/EPUB