为什么 int a = 1的变量 a是 istore_1 如果是按照顺序来说为什么不是 istore_0 这里的取名规则是怎样的
public class Test {
public int MethodMath(){
int a = 1;
int b = 2;
int c = (a + b) * 10;
return 0;
}
}
public int MethodMath();
Code:
0: iconst_1
1: istore_1
2: iconst_2
3: istore_2
4: iload_1
5: iload_2
6: iadd
7: bipush 10
9: imul
10: istore_3
11: iconst_0
12: ireturn
istore_{N}是将引用地址存储到编号为N的局部变量中,N指代LocalVariableTable中槽位编号