first steps:
word r0,r1,stack1#1,l2,stack3#1
r0:=@this.test
load.r r0
stack0#2 = stack1#1
push 2
store.i l2
load.i l2
store.i $stack2#1
staticget <java.lang.System: java.io.printStream Out>
store.i l3
load.i l3
add.i
virtualinvoke <java.io.printStream: void println(int)>
next steps: load/store
word r0,stack0#2,l1,l2,l3
r0:=this.test
load.r r0
specialinvoke <java.lang.Object: void <init>()>
r0:=@parameter0:java.lang.String[]
push 1
store.i l1
load.i l1
store.i l1#1
push 2
store.i l2
load.i l2
store.i l2#1
staticget <java.lang.System: java.io.printStream Out>
store.i l3
load.i l3
add.i
virtualinvoke <java.io.printStream: void println(int)>
next steps: packing
word r0,l1,l2,l3
r0:=this.test
load.r r0
specialinvoke <java.lang.Object: void <init>()>
r0:=@parameter0:java.lang.String[]
push 1
store.i l1
load.i l1
push 2
store.i l2
load.i l2
staticget <java.lang.System: java.io.printStream Out>
store.i l3
load.i l3
add.i
virtualinvoke <java.io.printStream: void println(int)>
last steps:
aload_0
invokespecial
return
iconst_1
istore_1
iload_1
iconst_2
istore_2
iload_2
getstatic
istore_3
iload_3
iadd
virtualinvoke
return
最终得到
public test();
flags: ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String[]);
flags: ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=4, args_size=1
0: iconst_1
1: istore_1
2: iconst_2
3: istore_2
4: iload_1
5: iload_2
6: iadd
7: istore_3
8: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
11: iload_3
12: invokevirtual #3 // Method java/io/PrintStream.println:(I)V
15: return
网友评论