Java Virtual Machine (Java Series)

prev next contents
return

return from method

Jasmin Syntax

return Stack

Before

After
... ...
Description

return is used to return from a method whose return type is void.

All items on the current method's operand stack are discarded. If the current method is marked as synchronized, then an implicit monitorexit instruction is executed. Then the current method's frame is discarded, the invoker's frame is reinstated, and control returns to the invoker.

Example

; the following method takes no parameters, performs no actions, and returns no results. .method identity()V return ; simply return with no result .end method Bytecode

Type

Description
u1 return opcode = 0xB1 (177)
See Also

lreturn, freturn, dreturn, areturn, ireturn


prev next contents
Java Virtual Machine, by Jon Meyer and Troy Downing, O'Reilly Associates

Категории