赞
踩
java -jar asc.jar -import builtin.abc -import toplevel.abc test.as
avmplus test.abc
a = b + c;
a += b;
acc += 5;acc -= 3;
iconst_1iconst_2iaddistore_0
mov eax, 1
add eax, 2
public class EvalOrderDemo { public static void main(String[] args) { int[] arr = new int[1]; int a = 1; int b = 2; arr[0] = a + b; }}
// 左子树:数组下标// a[0]aload_1iconst_0// 右子树:加法// aiload_2// biload_3// +iadd// 根节点:赋值iastore
public class Demo { public static void foo() { int a = 1; int b = 2; int c = (a + b) * 5; }}
0: iconst_11: istore_02: iconst_23: istore_14: iload_05: iload_16: iadd7: iconst_58: imul9: istore_210: return
dx --dex --verbose --dump-to=Demo.dex.txt --dump-method=Demo.foo --verbose-dump Demo.class
0000: const/4 v0, #int 1 // #1
0001: const/4 v1, #int 2 // #2
0002: add-int/2addr v0, v1
0003: mul-int/lit8 v0, v0, #int 5 // #05
0005: return-void
int c = (a + b) * 5;
int c = (1 + 2) * 5;
int c = 15;
0000: const/4 v0, #int 1 // #1
0001: const/4 v1, #int 2 // #2
0002: add-int v2, v0, v1
0004: mul-int/lit8 v2, v2, #int 5 // #05
0006: return-void
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。