Home : Course Map : Chapter 5 : Java : Supplements :
JVM Instructions Part 2:
Class & Array Opcodes
JavaTech
Course Map
Chapter 5
File/Package/Import
  Demo 1
  Demo 2
Access/Visibility
final & Constants
Static Import
Jar Files
  Demo 3
Applet Directories
3rd Party Packages
CLASSPATH
javadoc
CodingConventions
Exercises

    Supplements
Scope
Debug Techniques
Java Runtime
Class Class
JVM Instructions 2
JVM Processing
pack200

     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

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

            Tech
DecimalFormat
  Demo 1
  Demo 2

System.out.printf
  Demo 3
CJ Format Class
  Demo 4   Demo 5
Other Format Tools

Immutable Complex
Exercises

           Physics
Interpolation
Integration
  Demo 1
Simpson Rule
  Demo 2
Exercises

  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.