jsr 0xa8
Jumps to a subroutine, pushing the return address (old finally blocks; not allowed since Java 7 class files).
- Opcode
0xa8(168)- Family
- Branches and switches
- Operands
- 2 bytes: signed branch offset
- Length
- 3 bytes
- Operand stack
… → …, address- Can throw
- nothing at run time (beyond linking errors)
What it does
Pushes the address of the next instruction and jumps to a subroutine.
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.ret Returns from a subroutine to the address in a local variable.athrow Throws the exception on top of the stack.
Specification: JVMS §6.5, jsr (Java SE 25).