Jump to the class file directory using

javap -c StringTest.class -> p.txt

1

Command to output the compiled file to the p.txt file

Stack and local variable manipulation

An instruction to push a constant onto the stack

Aconst_null pushes the NULL object reference onto the stack

Iconst_m1 pushes a constant of type int -1

Iconst_0 pushes the constant 0 of type int

Iconst_1 pushes a constant of type int 1

Iconst_2 pushes a constant of type 2 int

Iconst_3 pushes a constant of type int 3

Iconst_4 pushes a constant of type 4 int

Iconst_5 pushes the constant 5 of type int

Lconst_0 pushes the constant 0 of type long onto the stack

Lconst_1 pushes a constant of type 1 of long onto the stack

Fconst_0 pushes the constant 0 of type float onto the stack

Fconst_1 pushes the constant of type float 1 onto the stack

Dconst_0 pushes the constant 0 of type double onto the stack

Dconst_1 pushes the constant of type 1 double onto the stack

Bipush pushes an 8-bit signed integer onto the stack

Sipush pushes 16-bit signed integers onto the stack

The LDC pushes items in the constant pool onto the stack

Ldc_w pushes items in the constant pool (using wide indexes)

Ldc2_w pushes items of type long or double in the constant pool (using wide indexes)

An instruction to load values from local variables in the stack

Iload loads int values from local variables

Lload loads values of type long from local variables

Fload loads a float value from a local variable

Dload loads values of type double from local variables

Aload loads reference type values from local variables (RefernCE)

Iload_0 loads int values from local variable 0

Iload_1 loads int values from local variable 1

Iload_2 loads int values from local variable 2

Iload_3 loads int values from local variable 3

Lload_0 loads a value of type long from local variable 0

Lload_1 loads a value of type long from local variable 1

Lload_2 loads a value of type long from local variable 2

Lload_3 loads a value of type long from local variable 3

Fload_0 loads a value of type float from local variable 0

Fload_1 loads a value of type float from local variable 1

Fload_2 loads a value of type float from local variable 2

Fload_3 loads a value of type float from local variable 3

Dload_0 loads a value of type double from local variable 0

Dload_1 loads a value of type double from local variable 1

Dload_2 loads a value of type double from local variable 2

Dload_3 loads a value of type double from local variable 3

Aload_0 loads the reference type value from local variable 0

Aload_1 loads the reference type value from local variable 1

Aload_2 loads the reference type value from local variable 2

Aload_3 loads the reference type value from local variable 3

Iaload loads int values from arrays

Laload loads values of type long from an array

Faload loads a float value from an array

Daload loads a double value from an array

Aaload loads reference type values from an array

Baload loads byte or Boolean values from an array

Caload loads a char value from an array

Saload loads short values from an array

An instruction to store a stack value to a local variable

Istore stores int values into local variables

Lstore stores values of type long into local variables

Fstore stores a float value into a local variable

Dstore stores values of type double into local variables

Astore stores a reference type or returnAddress type value into a local variable

Istore_0 stores a value of type int into the local variable 0

Istore_1 stores a value of type int to the local variable 1

Istore_2 stores a value of type int to local variable 2

Istore_3 stores a value of type int to the local variable 3

Lstore_0 stores a value of type long into the local variable 0

Lstore_1 stores a value of type long into the local variable 1

Lstore_2 stores a value of type long into local variable 2

Lstore_3 stores a value of type long into local variable 3

Fstore_0 stores a value of type float into the local variable 0

Fstore_1 stores a float value into the local variable 1

Fstore_2 stores a value of type float into local variable 2

Fstore_3 stores a value of type float into local variable 3

Dstore_0 stores a value of type double into the local variable 0

Dstore_1 stores a value of type double into the local variable 1

Dstore_2 stores a value of type double into local variable 2

Dstore_3 stores a value of type double into local variable 3

Astore_0 stores a reference type or returnAddress type value into the local variable 0

Astore_1 stores a reference type or returnAddress type value into the local variable 1

Astore_2 stores a reference type or returnAddress type value into local variable 2

Astore_3 stores the reference type or returnAddress type value into the local variable 3

Iastore stores int values into arrays

Lastore stores values of type long into an array

Fastore stores a float value into an array

Dastore stores a value of type double into an array

Aastore stores reference type values into an array

Bastore stores byte or Boolean values into arrays

Castore stores char values into arrays

Sastore stores short values into an array

Wide instruction

Wide extends the local variable index with additional bytes

Generic (no type) stack operation

Nop does nothing

Pop Pops a word at the top of the stack

Pop2 pops two words at the top of the stack

Dup copies the top of the stack one word long

Dup_x1 copies the one word at the top of the stack and then pushes the copy along with the original popup of two words

Dup_x2 copies the one word at the top of the stack, and then pushes the copied content onto the stack along with the original pop-up three words

Dup2 copies the top two words of the stack

Dup2_x1 copies the top two words of the stack and then pushes the copied contents onto the stack along with the original pop-up three words

Dup2_x2 copies the top two words of the stack and then pushes the copied contents onto the stack along with the original pop-up four words

Swap swaps the top two words of the stack

Type conversion

I2l converts int to long

I2f converts int data to float

I2d converts an int to a double

L2i converts long data to int

L2f converts long data to float

L2d converts long data to double

F2i converts a float to an int

F2l converts data of type float to long

F2d converts a float to a double

D2i converts a double to an int

D2l converts a double to a long

D2f converts data of type double to float

I2b converts int data to byte

I2c converts int data to char

I2s converts int data to short

Integer arithmetic

Iadd performs addition of int type

Ladd performs addition of type long

Isub performs subtraction of type int

Lsub performs subtraction of type long

Imul performs multiplication of type int

Lmul performs multiplication of type long

Idiv performs division of type int

Ldiv performs division of type long

Irem computes the remainder of an int division

Lrem computes the remainder of a division of type long

Ineg Reverses the value of an int

Lneg inverts a value of type long

Iinc adds a constant value to a local variable of type int

Logical operations

Shift operation

Ishl performs a shift of type int to the left

LSHL performs a shift to the left of type long

Ishr performs a shift to the right of type int

LSHR performs a shift to the right of type LONG

Iushr performs a logical shift to the right of int

Lushr performs a logical shift to the right of type LONG

Bitwise Boolean operation

Iand performs logical and operations on values of int type

Land performs logical and operations on values of type long

Ior performs logical or operations on values of type int

Lor performs logical or operations on values of type long

Ixor performs logical xor operations on values of int type

Lxor performs logical xor operations on values of type long

Floating point arithmetic

Fadd performs float addition

Dadd performs addition of type double

Fsub performs subtraction of type float

Dsub performs subtraction of type double

Fmul performs a float multiplication

Dmul performs multiplication of type double

Fdiv performs a float division

Ddiv performs a division of type double

Frem computes the remainder of a float division

Drem evaluates the remainder of a division of type double

Fneg inverts a value of type float

Dneg inverts a value of type double

Objects and Arrays

Object operation instruction

New Creates a new object

Checkcast Determines that the object is of the given type

Getfield retrieves the field from the object

Putfield Sets the value of a field in an object

Getstatic gets static fields from the class

Putstatic Sets the value of the static field in the class

Instanceof determines whether an object is of a given type

Array manipulation instruction

Newarray allocates a newarray of data members of type basic data

Anewarray allocates anewarray of data members of type reference

Arraylength gets the length of the array

Multianewarray allocates anew multidimensional array

The control flow

Conditional branch instruction

If ifeq equals 0, jump

If ifne is not equal to 0, the system jumps

If iFLT is less than 0, the system jumps

If ifGE is greater than or equal to 0, the system jumps

If ifgt is greater than 0, the system jumps

If ifLE is less than or equal to 0, the system jumps

If_icmpcq Jumps if two ints are equal

If_icmpne Jumps if two ints are not equal

If_icmplt Jumps if one int value is less than another int

If_icmpge Jumps if one int value is greater than or equal to another int

If_icmpgt If one int value is greater than another int value, this command jumps

If_icmple Jumps if one int is less than or equal to another int

Ifnull If equal to null, the jump

Ifnonnull If the value is not null, the system jumps

If_acmpeq Jumps if two object references are equal

If_acmpnc Jumps if two object references are not equal

More instructions

LCMP compares values of type long

FCMPL compares float values (-1 when NaN is encountered)

FCMPG compares values of type float (returns 1 when NaN is encountered)

DCMPL compares values of type double (-1 when NaN is encountered)

DCMPG compares values of type double (returns 1 when NaN is encountered)

Unconditional transfer instruction

Goto Unconditional jump

Goto_w Unconditional jump (wide index)

Table jump instruction

Tableswitch Accesses the hop table based on indexes and hops

Lookupswitch accesses jump tables by key value matching and performs jumps

abnormal

Athrow throws an exception or error

The finally clause

JSR jumps to the subroutine

Jsr_w Jumps to a subroutine (wide index)

The RCT returns from the subroutine

Method calls and returns

Method call instruction

The InvokCVirtual runtime invokes instance methods based on the object’s class

Invokespecial invokes instance methods based on compile-time types

Invokestatic invokes class (static) methods

Invokcinterface invokes interface methods

Method return instruction

Ireturn returns int data from the method

Lreturn returns data of type long from the method

Freturn returns data of type float from the method

Dreturn returns data of type double from the method

Areturn returns referenced type data from the method

Return Returns void from a method

Thread synchronization

Montiorenter enters and retrieves the object monitor

Monitorexit releases and exits the object monitor

JVM instruction mnemonic

Variable to operand stack: ILoad, ILoAD_,lload,lload_,fload,fload_,dload,dload_, ALOad, ALOad_

Operand stack to variables: istore,istore_,lstore,lstore_,fstore,fstore_,dstore,dstor_,astore,astore_

Constant to operand stack: bipush,sipush, LDC, LDC_w, LDC2_W, aconst_NULL, iconst_ML,iconst_, LCONST_, fCONST_, dCONST_

Add: iadd, ladd, fadd, dadd

Reduction: isub, lsub fsub, dsub

Passenger: imul lmul, fmul dmul

In addition: idiv ldiv, fdiv ddiv

Remainder: irem, lrem frem, drem

Take negative: ineg, lneg fneg, dneg

Shift: ishl, LSHR iushr, LSHL, LSHR, lushr

Bitwise or: ior, LOR

Bitwise and: iAND,land

Bitwise xOR: ixOR, lxOR

Type conversion: i2L,i2f, i2D, L2F, l2D, f2D (relaxed numeric conversion)

I2b, i2c, i2s l2i f2i, f2l, d2i, d2l, d2f (narrowing conversion)

Create the class: new

Create a new array: newarray, anewarray multianwarray

Access to the class and class instance domains:, getfield, putfield getstatic, putstatic

The data loaded into the operand stack: baload, caload, saload, iaload, laload, faload, daload, aaload

From the operand stack memory stored in the array: bastore, castore, sastore, iastore, lastore, fastore, dastore, aastore

Gets the arraylength: arraylength

Class instance or array properties: instanceof,checkcast

Operand stack management: POP, POP2, DUP, DUp2, dup_XL, dup2_XL, DUp_x2,dup2_x2,swap

Conditional transfer: ifeq, iflt ifle, ifne, ifgt, ifge, ifnull, ifnonnull, if_icmpeq, if_icmpene,

if_icmplt,if_icmpgt,if_icmple,if_icmpge,if_acmpeq,if_acmpne,lcmp,fcmpl

fcmpg,dcmpl,dcmpg

Compound conditional transfer: Tableswitch,lookupswitch

Unconditional transfer: GOto, GOTO_W, JSR, jSR_W, RET

A convenient method for scheduling objects: Invokevirtual

Invoke the method implemented by the interface: InvokeInterface

Invoke the instance method that requires special processing: Invokespecial

Invoke the static method in the named class: Invokestatic

Returns: ireturn, lreturn freturn, dreturn, areturn, return

Exception: athrow

The finally keyword is implemented using JSR, jSR_w,ret


Spring, Dubbo, MyBatis, RPC, source code analysis, high concurrency, high performance, distributed, performance optimization, micro services advanced architecture development and other learning materials