129.

prev next contents
aload_<n>

retrieve object reference from local variable <n>

Jasmin Syntax
     aload_0 or     aload_1 or     aload_2 or     aload_3 
Stack

Before

After
...
objectref

...
Description

aload_<n> represents the series of opcodes aload_0, aload_1, aload_2, and aload_3 that retrieve an object reference held in local variables 0, 1, 2 or 3 and push it onto the stack. <n> must be a valid local variable number in the current frame.

'aload_<n>' is functionally equivalent to 'aload <n>', although it is typically more efficient and also takes fewer bytes in the bytecode.

Example

 aload_0         ;push object in local variable 0 aload_1         ;push object in local variable 1 aload_2         ;push object in local variable 2 aload_3         ;push object in local variable 3 
Bytecode

Type

Description
u1
aload_0 opcode = 0x2A (42)
u1
aload_1 opcode = 0x2B (43)
u1
aload_2 opcode = 0x2C (44)
u1
aload_3 opcode = 0x2D (45)
See Also

fload, iload, lload, dload

Notes

If you use astore to store a returnAddress in a local variable, you cannot then use aload_<n> to retrieve the value of that local variable. Instead, if a local variable holds a returnAddress, your only choices are to (1) use ret to return to that address, or (2) use one of the store instructions to store some other value in the local variable.


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


Java Virtual Machine
Java Virtual Machine (Java Series)
ISBN: 1565921941
EAN: 2147483647
Year: 1996
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net