Talk about the JVM, recently cracked jar in the study, have experience in this area to guide us trouble thinking ..
reference
Reference 1
command organizing
Common commands
1 |
|
Local variable type
Special character representation | Types of | description |
---|---|---|
c | char | char type |
i | int | int type |
l | long | long type |
s | short | short type |
b | byte | byte type |
f | float | float type |
with | boolean | Boolean |
a | reference | Quote |
Methods Information
1 |
L1 |
Local variable parameters LOCALVARIABLE
local table size MAXLOCALS
operand stack size MAXSTACK
instruction
Operation Instructions
Arithmetic instructions for two
操作数栈
values of a particular operation is performed, and the result is stored back to操作栈
the top.
- Addition instruction: iadd, ladd, fadd, dadd
- Subtraction instruction: isub, lsub, fsub, dsub
- Multiply instructions: imul, lmul, fmul, dmul
- Division instructions: idiv, ldiv, fdiv, ddiv
- Remainder instruction: irem, lrem, frem, drem
- Invert instructions: ineg, leng, fneg, dneg
- Motion commands: ishl, ishr, iushr, lshl, lshr, lushr
- Bitwise or instructions: ior, lor
- Bitwise AND instruction: iand, land
- Bitwise XOR instruction: ixor, lxor
- Increment local variable instruction: iinc
- Compare instruction: dcmpg, dcmpl, fcmpg, fcmpl, lcmp
Load and store instructions
For
局部变量表
and操作数栈
transferred back and forth between the
- A local variable is loaded into the instruction operand stack comprising: iload, iload_ <n>, lload, lload_ <n>, float, fload_ <n>, dload, dload_ <n>, aload, aload_ <n>.
- Storing a value from the stack into local variable target operand instructions: istore, istore_ <n>, lstore, lstore_ <n>, fstore, fstore_ <n>, dstore, dstore_ <n>, astore, astore_ <n>
- The constant is loaded into the operand stack instructions: bipush, sipush, ldc, ldc_w, ldc2_w, aconst_null, iconst_ml, iconst_ <i>, lconst_ <l>, fconst_ <f>, dconst_ <d>
- Access the local variable table index instruction: wide
portion of instructions ending angle brackets represent a set of instructions, such as iload_ <i>, it represents iload_0, iload_1 the like, these are the set of instructions with a general-purpose instruction operand.
Operation Instructions
Of two
操作数栈
values on a specific operation is performed, and the result is stored back to操作栈
the top
- Addition instruction: iadd, ladd, fadd, dadd
- Subtraction instruction: isub, lsub, fsub, dsub
- Multiply instructions: imul, lmul, fmul, dmul
- Division instructions: idiv, ldiv, fdiv, ddiv
- Remainder instruction: irem, lrem, frem, drem
- Invert instructions: ineg, leng, fneg, dneg
- Motion commands: ishl, ishr, iushr, lshl, lshr, lushr
- Bitwise or instructions: ior, lor
- Bitwise AND instruction: iand, land
- Bitwise XOR instruction: ixor, lxor
- Increment local variable instruction: iinc
- Compare instruction: dcmpg, dcmpl, fcmpg, fcmpl, lcmp
Type Conversion
The two Java virtual machine numeric type conversion
JVM support a wide conversion types (small type conversion to a wide range of types):
- int type to long, float, double type
- long type to float, double type
- float to double type
Object creation and operation
Although class instances and arrays are objects, Java virtual machines that use different bytecode instructions and the operation for creating class instances and arrays.
- Command to create an instance of: new
- Create an array of command: newarray, anewarray, multianewarray
- Access field of the instruction: getfield, putfield, getstatic, putstatic
- The array element is loaded into the operand stack instructions: baload, caload, saload, iaload, laload, faload, daload, aaload
- The operand stack is the value stored in the array element is performed: bastore, castore, castore, sastore, iastore, fastore, dastore, aastore
- Instruction fetch array length: arraylength
- Examples of type checking instructions: instanceof, checkcast
Management instruction operand stack
Direct operation instruction operand stack: pop, pop2, dup, dup2, dup_x1, dup2_x1, dup_x2, dup2_x2 and swap
NOTE: onto stack (DUP) / pop stack (POP)
Control transfer instruction
- Conditional branch: ifeq, if a large column talk JVM, bytecode lt, ifle, ifne, ifgt, ifge, ifnull, ifnotnull, if_cmpeq, if_icmpne, if_icmlt, if_icmpgt etc.
- Complex conditional branch: tableswitch, lookupswitch
- Unconditional branch: goto, goto_w, jsr, jsr_w, ret
Method call and return instructions
- invokevirtual instruction: call object instance method, is dispatched (assigned virtual machine) based on the actual type of the object.
- invokeinterface instruction: call interface method at runtime object that implements this interface to search for a method of finding the right method call.
- invokespecial: calls require special treatment instance method, instance initialization method comprising, parent private methods and methods
- invokestatic: call the class method (static)
- Method return instruction is a return type distinguishing value, comprising ireturn (return value is boolean, byte, char, short, and int), lreturn, freturn, drturn and areturn, another return for void method, instance initialization method, classes, and i interface class initialization method used.
Synchronize
Eg:
1 |
// class version 52.0 (52) |