What does 'a' mean in JVM instructions like 'aload' or 'areturn'?

Viewed 714

What does 'a' mean in JVM instructions like 'aload' or 'areturn'? I know they operate on references, but why are they named 'aload', 'astore', etc instead of 'rload', 'rstore', etc?

1 Answers

I believe historically 'a' stands for 'address' since the times when an object reference was just a plain address into the heap.

The support for this idea can be found in the sources of K virtual machine by Sun Microsystems - one of the first Java Virtual Machines for Java ME. The sources can be downloaded from CLDC 1.1 RI page.

The fragment from kvm/VmCommon/src/bytecodes.c:

#if STANDARDBYTECODES
SELECT(ILOAD)            /* Load integer from local variable */
        unsigned int index = ip[1];
        pushStack(lp[index]);
DONE(2)
#endif

...

#if STANDARDBYTECODES
SELECT(ALOAD)            /* Load address from local variable */
        unsigned int index = ip[1];
        pushStack(lp[index]);
DONE(2)
#endif

here

Related