1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
| public int getA(); Code: 0: aload_0 1: getfield 4: ireturn
public void setA(int); Code: 0: aload_0 1: iload_1 2: putfield 5: return } ➜ bytecode git:(master) ✗ javap -verbose MyTest1 警告: 文件 ./MyTest1.class 不包含类 MyTest1 Classfile /Users/terwer/Documents/workspace/senior-java-engineer-road/p7-skill/jvm/jvm-demo/target/classes/com/terwergreen/jvm/bytecode/MyTest1.class Last modified 2022年3月2日; size 503 bytes MD5 checksum 9bb025ac2880ca6faf9ee236d4d947ae Compiled from "MyTest1.java" public class com.terwergreen.jvm.bytecode.MyTest1 minor version: 0 major version: 51 flags: (0x0021) ACC_PUBLIC, ACC_SUPER this_class: super_class: interfaces: 0, fields: 1, methods: 3, attributes: 1 Constant pool: { public com.terwergreen.jvm.bytecode.MyTest1(); descriptor: ()V flags: (0x0001) ACC_PUBLIC Code: stack=2, locals=1, args_size=1 0: aload_0 1: invokespecial 4: aload_0 5: iconst_1 6: putfield 9: return LineNumberTable: line 8: 0 line 9: 4 LocalVariableTable: Start Length Slot Name Signature 0 10 0 this Lcom/terwergreen/jvm/bytecode/MyTest1;
public int getA(); descriptor: ()I flags: (0x0001) ACC_PUBLIC Code: stack=1, locals=1, args_size=1 0: aload_0 1: getfield 4: ireturn LineNumberTable: line 12: 0 LocalVariableTable: Start Length Slot Name Signature 0 5 0 this Lcom/terwergreen/jvm/bytecode/MyTest1;
public void setA(int); descriptor: (I)V flags: (0x0001) ACC_PUBLIC Code: stack=2, locals=2, args_size=2 0: aload_0 1: iload_1 2: putfield 5: return LineNumberTable: line 16: 0 line 17: 5 LocalVariableTable: Start Length Slot Name Signature 0 6 0 this Lcom/terwergreen/jvm/bytecode/MyTest1; 0 6 1 a I } SourceFile: "MyTest1.java" ➜ bytecode git:(master) ✗
|