ret 0xa9

Returns from a subroutine to the address in a local variable.

Opcode
0xa9 (169)
Family
Branches and switches
Operands
  • 1 byte: local variable index
Length
2 bytes
Operand stack
… → …
Can throw
nothing at run time (beyond linking errors)

What it does

Jumps to the return address stored in a local variable by jsr.

Old compilers used jsr and ret to share one copy of a finally block among every exit from the try. They made verification hard, so modern javac copies the finally code onto each exit instead, and class files from version 51 (Java 7) on may not contain them at all.

How often javac uses it

It does not appear anywhere in JDK 25.0.5's java.base module: none of its 7,391 classes uses it.

Related instructions

goto Jumps unconditionally.jsr Jumps to a subroutine, pushing the return address (old finally blocks; not allowed since Java 7 class files).athrow Throws the exception on top of the stack.

Specification: JVMS §6.5, ret (Java SE 25).