Inside the Java 2 Virtual Machine
| |
| |
1997 The McGraw-Hill Companies, Inc. All rights reserved. Any use of this Beta Book is subject to the rules stated in the Terms of Use. |
Opcode Mnemonic by Function Group
Stack Operations (Chapter 10)
Instructions that push a constant onto the stack
aconst_null | Push null object reference |
iconst_m1 | Push int constant -1 |
iconst_0 | Push int constant 0 |
iconst_1 | Push int constant 1 |
iconst_2 | Push int constant 2 |
iconst_3 | Push int constant 3 |
iconst_4 | Push int constant 4 |
iconst_5 | Push int constant 5 |
lconst_0 | Push long constant 0 |
lconst_1 | Push long constant 1 |
fconst_0 | Push float constant 0.0 |
fconst_1 | Push float constant 1.0 |
fconst_2 | Push float constant 2.0 |
dconst_0 | Push double constant 0.0 |
dconst_1 | Push double constant 1.0 |
bipush | Push 8-bit signed integer |
sipush | Push 16-bit signed integer |
ldc | Push item from constant pool |
ldcw | Push item from constant pool (wide index) |
ldc2_w | Push long or double from constant pool (wide index) |
Instructions that load a local variable onto the stack
iload | Load int from local variable |
lload | Load long from local variable |
fload | Load float from local variable |
dload | Load double from local variable |
aload | Load reference from local variable |
iload_0 | Load int from local variable 0 |
iload_1 | Load int from local variable 1 |
iload_2 | Load int from local variable 2 |
iload_3 | Load int from local variable 3 |
lload_0 | Load long from local variable 0 |
lload_1 | Load long from local variable 1 |
lload_2 | Load long from local variable 2 |
lload_3 | Load long from local variable 3 |
fload_0 | Load float from local variable 0 |
fload_1 | Load float from local variable 1 |
fload_2 | Load float from local variable 2 |
fload_3 | Load float from local variable 3 |
dload_0 | Load double from local variable 0 |
dload_1 | Load double from local variable 1 |
dload_2 | Load double from local variable 2 |
dload_3 | Load double from local variable 3 |
aload_0 | Load reference from local variable 0 |
aload_1 | Load reference from local variable 1 |
aload_2 | Load reference from local variable 2 |
aload_3 | Load reference from local variable 3 |
iaload | Load int from array |
laload | Load long from array |
faload | Load float from array |
daload | Load double from array |
aaload | Load reference from array |
baload | Load byte or boolean from array |
caload | Load char from array |
saload | Load short from array |
Instructions that store a value from the stack into a local variable
istore | Store int into local variable |
lstore | Store long into local variable |
fstore | Store float into local variable |
dstore | Store double into local variable |
astore | Store reference or returnAddress into local variable |
istore_0 | Store int into local variable 0 |
istore_1 | Store int into local variable 1 |
istore_2 | Store int into local variable 2 |
istore_3 | Store int into local variable 3 |
lstore_0 | Store long into local variable 0 |
lstore_1 | Store long into local variable 1 |
lstore_2 | Store long into local variable 2 |
lstore_3 | Store long into local variable 3 |
fstore_0 | Store float into local variable 0 |
fstore_1 | Store float into local variable 1 |
fstore_2 | Store float into local variable 2 |
fstore_3 | Store float into local variable 3 |
dstore_0 | Store double into local variable 0 |
dstore_1 | Store double into local variable 1 |
dstore_2 | Store double into local variable 2 |
dstore_3 | Store double into local variable 3 |
astore_0 | Store reference or returnAddress into local variable 0 |
astore_1 | Store reference or returnAddress into local variable 1 |
astore_2 | Store reference or returnAddress into local variable 2 |
astore_3 | Store reference or returnAddress into local variable 3 |
iastore | Store into int array |
lastore | Store into long array |
fastore | Store into float array |
dastore | Store into double array |
aastore | Store into reference array |
bastore | Store into byte or boolean array |
castore | Store into char array |
sastore | Store into short array |
The wide instruction
wide | Extend a local variable index with additional bytes |
Generic (typeless) stack operations
nop | Do nothing |
pop | Pop top stack word |
pop2 | Pop top two stack words |
dup | Duplicate top stack word |
dup_x1 | Duplicate top stack word and put two down |
dup_x2 | Duplicate top stack word and put three down |
dup2 | Duplicate top two stack words |
dup2_x1 | Duplicate top two stack words and put two down |
dup2_x2 | Duplicate top two stack words and put three down |
swap | Swap top two stack words |
Type Conversion (Chapter 11)
i2l | Convert int to long |
i2f | Convert int to float |
i2d | Convert int to double |
l2i | Convert long to int |
l2f | Convert long to float |
l2d | Convert long to double |
f2i | Convert float to int |
f2l | Convert float to long |
f2d | Convert float to double |
d2i | Convert double to int |
d2l | Convert double to long |
d2f | Convert double to float |
i2b | Convert int to byte |
i2c | Convert int to char |
i2s | Convert int to short |
Integer Arithmetic (Chapter 12)
iadd | Add int s |
ladd | Add long s |
isub | Subtract int s |
lsub | Subtract long s |
imul | Multiply int s |
lmul | Multiply long s |
idiv | Divide int s |
ldiv | Divide long s |
irem | Calculate remainder of division of int s |
lrem | Calculate remainder of division of long s |
ineg | Negate int |
lneg | Negate long |
iinc | Increment int local variable by constant |
Logic (Chapter 13)
Shift operations
ishl | Perform left shift on int |
lshl | Perform left shift on long |
ishr | Perform arithmetic right shift on int |
lshr | Perform arithmetic right shift on long |
iushr | Perform logical right shift on int |
lushr | Perform logical right shift on long |
Bitwise boolean operations
iand | Perform boolean AND on int s |
land | Perform boolean AND on long s |
ior | Perform boolean OR on int s |
lor | Perform boolean OR on long s |
ixor | Perform boolean XOR on int s |
lxor | Perform boolean XOR on long s |
Floating Point Arithmetic (Chapter 14)
fadd | Add float s |
dadd | Add double s |
fsub | Subtract float s |
dsub | Subtract double s |
fmul | Multiply float s |
dmul | Multiply double s |
fdiv | Divide float s |
ddiv | Divide double s |
frem | Calculate remainder of division of float s |
drem | Calculate remainder of division of double s |
fneg | Negate float |
dneg | Negate double |
Objects and Arrays (Chapter 15)
Instructions that deal with objects
new | Create a new object |
checkcast | Make sure object is of a given type |
getfield | Fetch field from object |
putfield | Set field in object |
getstatic | Fetch static field from class |
putstatic | Set static field in class |
instanceof | Determine if an object is of a given type |
Instructions that deal with arrays
newarray | Allocate new array of primitive type components |
anewarray | Allocate new array of reference type components |
arraylength | Get length of an array |
multianewarray | Allocate a new multi-dimensional array |
Control Flow (Chapter 16)
Conditional branch instructions
ifeq | Branch if equal to 0 |
ifne | Branch if not equal to 0 |
iflt | Branch if less than 0 |
ifge | Branch if greater than or equal to 0 |
ifgt | Branch if greater than 0 |
ifle | Branch if less than or equal to 0 |
if_icmpeq | Branch if int s equal |
if_icmpne | Branch if int s not equal |
if_icmplt | Branch if int less than other int |
if_icmpge | Branch if int greater than or equal to other int |
if_icmpgt | Branch if int greater than other int |
if_icmple | Branch if int less than or equal to other int |
ifnull | Branch if null |
ifnonnull | Branch if not null |
if_acmpeq | Branch if object references are equal |
if_acmpne | Branch if object references not equal |
Comparison instructions
lcmp | Compare long s |
fcmpl | Compare float s (-1 on NaN) |
fcmpg | Compare float s (1 on NaN) |
dcmpl | Compare double s (-1 on NaN) |
dcmpg | Compare double s (1 on NaN) |
Unconditional branch instructions
goto | Branch always |
goto_w | Branch always (wide index) |
Table jumping instructions
tableswitch | Access jump table by index and jump |
lookupswitch | Access jump table by key match and jump |
Exceptions (Chapter 17)
athrow | Throw exception or error |
Finally Clauses (Chapter 18)
jsr | Jump to subroutine |
jsr_w | Jump to subroutine (wide index) |
ret | Return from subroutine |
Method Invocation and Return (Chapter 19)
Method invocation instructions
invokevirtual | Invoke instance method, dispatch based on run-time type |
invokespecial | Invoke instance method, dispatching based on compile-time type |
invokestatic | Invoke a class (static) method |
invokeinterface | Invoke interface method |
Method return instructions
ireturn | Return int from method |
lreturn | Return long from method |
freturn | Return float from method |
dreturn | Return double from method |
areturn | Return reference from method |
return | Return ( void ) from method |
Thread Synchronization (Chapter 20)
monitorenter | Enter and acquire object monitor |
monitorexit | Release and exit object monitor |
| |
|
COMPUTING MCGRAW-HILL Beta Books Contact Us Order Information Online Catalog
Computing McGraw-Hill is an imprint of the McGraw-Hill Professional Book Group.
Copyright 1997 The McGraw-Hill Companies. All rights reserved. Any use is subject to the Terms of Use; the corporation also has a comprehensive Privacy Policy governing information we may collect from our customers.
Категории