public class T { // 常量池中分配 String final private String a = "aa"; // 常量池中分配 final int ee = 22; // 堆中分配 int ff = 20; // 超过一定的范围 在常量池中 int ff2 = 200000; // 堆中分配 Integer i = 4; // 超过一定的范围 在常量池中 Integer i2 = 444444; // 堆中分配 final Integer ii = 544; // 超过一定的范围 在常量池中 final Integer ii2 = 55555; public void t() { // 常量池中分配 String final String b = "bb"; // 常量池中分配 final String c = "cc"; // 栈中分配 int f = 1; // 超过一定的范围 在常量池中 int f1 = 111111; // 栈中分配 final int f2 = 33; // 超过一定的范围 在常量池中 final int f3 = 33333; }}
const #2 = Asciz T;const #3 = class #4; // java/lang/Objectconst #4 = Asciz java/lang/Object;const #5 = Asciz a;const #6 = Asciz Ljava/lang/String;;const #7 = Asciz ee;const #8 = Asciz I;const #9 = Asciz ConstantValue;const #10 = int 22;const #11 = Asciz ff;const #12 = Asciz ff2;const #13 = Asciz i;const #14 = Asciz Ljava/lang/Integer;;const #15 = Asciz i2;const #16 = Asciz ii;const #17 = Asciz ii2;const #18 = Asciz;const #19 = Asciz ()V;const #20 = Asciz Code;const #21 = Method #3.#22; // java/lang/Object." ":()Vconst #22 = NameAndType #18:#19;// " ":()Vconst #23 = String #24; // aaconst #24 = Asciz aa;const #25 = Field #1.#26; // T.a:Ljava/lang/String;const #26 = NameAndType #5:#6;// a:Ljava/lang/String;const #27 = Field #1.#28; // T.ee:Iconst #28 = NameAndType #7:#8;// ee:Iconst #29 = Field #1.#30; // T.ff:Iconst #30 = NameAndType #11:#8;// ff:Iconst #31 = int 200000;const #32 = Field #1.#33; // T.ff2:Iconst #33 = NameAndType #12:#8;// ff2:Iconst #34 = Method #35.#37; // java/lang/Integer.valueOf:(I)Lang/Integer;const #35 = class #36; // java/lang/Integerconst #36 = Asciz java/lang/Integer;const #37 = NameAndType #38:#39;// valueOf:(I)Ljava/lang/Integer;const #38 = Asciz valueOf;const #39 = Asciz (I)Ljava/lang/Integer;;const #40 = Field #1.#41; // T.i:Ljava/lang/Integer;const #41 = NameAndType #13:#14;// i:Ljava/lang/Integer;const #42 = int 444444;const #43 = Field #1.#44; // T.i2:Ljava/lang/Integer;const #44 = NameAndType #15:#14;// i2:Ljava/lang/Integer;const #45 = Field #1.#46; // T.ii:Ljava/lang/Integer;const #46 = NameAndType #16:#14;// ii:Ljava/lang/Integer;const #47 = int 55555;const #48 = Field #1.#49; // T.ii2:Ljava/lang/Integer;const #49 = NameAndType #17:#14;// ii2:Ljava/lang/Integer;const #50 = Asciz LineNumberTable;const #51 = Asciz LocalVariableTable;const #52 = Asciz this;const #53 = Asciz LT;;const #54 = Asciz t;const #55 = String #56; // bbconst #56 = Asciz bb;const #57 = String #58; // ccconst #58 = Asciz cc;const #59 = int 111111;const #60 = int 33333;const #61 = Asciz b;const #62 = Asciz c;const #63 = Asciz f;const #64 = Asciz f1;const #65 = Asciz f2;const #66 = Asciz f3;const #67 = Asciz SourceFile;const #68 = Asciz T.java;{final int ee; Constant value: int 22int ff;int ff2;java.lang.Integer i;java.lang.Integer i2;final java.lang.Integer ii;final java.lang.Integer ii2;public T(); Code: Stack=2, Locals=1, Args_size=1 0: aload_0 1: invokespecial #21; //Method java/lang/Object." ":()V 4: aload_0 5: ldc #23; //String aa 7: putfield #25; //Field a:Ljava/lang/String; 10: aload_0 11: bipush 22 13: putfield #27; //Field ee:I 16: aload_0 17: bipush 20 19: putfield #29; //Field ff:I 22: aload_0 23: ldc #31; //int 200000 25: putfield #32; //Field ff2:I 28: aload_0 29: iconst_4 30: invokestatic #34; //Method java/lang/Integer.valueOf:(I)Ljava/lteger; 33: putfield #40; //Field i:Ljava/lang/Integer; 36: aload_0 37: ldc #42; //int 444444 39: invokestatic #34; //Method java/lang/Integer.valueOf:(I)Ljava/lteger; 42: putfield #43; //Field i2:Ljava/lang/Integer; 45: aload_0 46: sipush 544 49: invokestatic #34; //Method java/lang/Integer.valueOf:(I)Ljava/lteger; 52: putfield #45; //Field ii:Ljava/lang/Integer; 55: aload_0 56: ldc #47; //int 55555 58: invokestatic #34; //Method java/lang/Integer.valueOf:(I)Ljava/lteger; 61: putfield #48; //Field ii2:Ljava/lang/Integer; 64: return LineNumberTable: line 1: 0 line 4: 4 line 7: 10 line 9: 16 line 11: 22 line 15: 28 line 17: 36 line 19: 45 line 22: 55 line 1: 64 LocalVariableTable: Start Length Slot Name Signature 0 65 0 this LT;public void t(); Code: Stack=1, Locals=7, Args_size=1 0: ldc #55; //String bb 2: astore_1 3: ldc #57; //String cc 5: astore_2 6: iconst_1 7: istore_3 8: ldc #59; //int 111111 10: istore 4 12: bipush 33 14: istore 5 16: ldc #60; //int 33333 18: istore 6 20: return LineNumberTable: line 26: 0 line 28: 3 line 30: 6 line 32: 8 line 34: 12 line 36: 16 line 37: 20 LocalVariableTable: Start Length Slot Name Signature 0 21 0 this LT; 3 18 1 b Ljava/lang/String; 6 15 2 c Ljava/lang/String; 8 13 3 f I 12 9 4 f1 I 16 5 5 f2 I 20 1 6 f3 I}