In Chapter 2: JVM
Instructions Part 1 we listed the opcodes for arithmetic operations
and for stack and memory access. Here we give list the operations
dealing with class and arrays.
Note: In Java an array is a
class and not a primitive type but the JVM nevertheless holds some
special instructions just for array handling to speed up their processing.
Object Instructions |
- new
- create an instance of a class
- instanceof
- query an object for its class type
- checkcastCheck
- properties of class instances or arrays
|
Field Instructions |
- getfield/putfield
- Load on the stack / store onto the heap a reference
to a field of a class instance, that is, a instance
variable.
- getstatic/putstatic
- Load on the stack / store onto the heap, a reference
to a static field, also known as a class variable.
|
Method Instructions |
- invokevirtual
- invokes an instance method of an object, dispatching
on the (virtual) type of the object. This is the normal
method dispatch in the Java programming language.
- invokeinterface
- invokes a method that is implemented by an interface,
searching the methods implemented by the particular runtime
object to find the appropriate method.
- invokespecial
- invokes an instance method requiring special handling,
whether an instance initialization method, a private method,
or a superclass method.
- invokestatic
- invokes a class (static) method in a named class.
- ireturn
- used to return values of type boolean, byte, char, short,
or int)
- lreturn,
freturn
, dreturn,
and areturn
-
- return
- return from methods declared to be void, instance initialization
methods, and class or interface initialization methods.
|
Array Instructions |
- newarray,
anewarray, multianewarray - create a new array.
- baload,
caload, saload, iaload, laload, faload, daload, aaload
- load an array component onto the operand stack.
- bastore,
castore, sastore, iastore, lastore, fastore, dastore,
aastore - store a value from the operand stack
as an array component.
- arraylength
- provides the the length of array.
|
Miscellaneous Instructions |
- athrow
- throw an exception. Note that other JVM instructions
can also throw exceptions when they detect an abnormal
condition.
- jsr,
jsr_w,
and ret
- used by the finally
keyword uses the
- monitorenter/monitorexit
- monitor used to block/unblock access to other threads
when one thread enters/exits a synchronized method of
an object.
|
References & Resources
Most recent update: Oct. 5, 2005
|