lreturn 0xad
Returns the long on top of the stack from the method.
- Opcode
0xad(173)- Family
- Returns
- Operands
- none
- Length
- 1 byte
- Operand stack
…, value (long) → …, (empty: the frame is gone)- Can throw
IllegalMonitorStateException
What it does
Returns the long on top of the stack to the caller, which finds it on its own operand stack.
The IllegalMonitorStateException is for a synchronized method whose monitor is no longer held, which javac never produces.
How often javac uses it
In JDK 25.0.5's java.base module, lreturn appears 1,825 times in 532 of its 7,391 classes: 0.09% of all instructions, the 93rd most common of 194 opcodes in use. Some of the methods that use it: java.io.BufferedInputStream.skip, java.io.BufferedReader.skip, java.io.ByteArrayInputStream.transferTo, java.io.CharArrayReader.skip.
Examples
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; lreturn is highlighted.
long assignLongField(long v) in Tour, compiled by javac 25static long staticLong() in Increments, compiled by javac 25Related instructions
ireturn Returns the int on top of the stack from the method.areturn Returns the reference on top of the stack from the method.return Returns from a void method.
Specification: JVMS §6.5, lreturn (Java SE 25).