reference
into local variableastore | |
index |
Description
The index is an unsigned byte that must be a valid index into the local variables of the current frame (§3.6). The objectref on the top of the operand stack must be of type returnAddress
or of type reference
. It is popped from the operand stack, and the value of the local variable at index is set to objectref.
Notes
The astore instruction is used with an objectref of type return
-Address
when implementing Java's finally
keyword (see Section 7.13, "Compiling finally"). The aload instruction cannot be used to load a value of type returnAddress
from a local variable onto the operand stack. This asymmetry with the astore instruction is intentional.
The astore opcode can be used in conjunction with the wide instruction to access a local variable using a two-byte unsigned index.