提交 132b8d06 编写于 作者: 1 13.beta2

core: inlining invoke arguments

protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(2130837505);
-->
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.samplelayout);
上级 5dc4c28d
......@@ -148,6 +148,8 @@ public class InsnGen {
String thisClass = mth.getParentClass().getFullName();
if (thisClass.startsWith(field.getDeclClass().getFullName())) {
return field.getName();
} else if (field.getDeclClass().getFullName().startsWith(mth.getParentClass().getPackage() + ".R")) {
return field.getDeclClass().getNameWithoutPackage() + '.' + field.getName();
} else {
return useClass(field.getDeclClass()) + '.' + field.getName();
}
......
......@@ -86,6 +86,18 @@ public class ModVisitor extends AbstractVisitor {
} else {
replaceInsn(block, i, co);
}
} else {
if (inv.getArgsCount() > 0) {
for (int j = 0; j < inv.getArgsCount(); j++) {
InsnArg arg = inv.getArg(j);
if (arg.isLiteral()) {
f = parentClass.getConstFieldByLiteralArg((LiteralArg) arg);
if (f != null) {
arg.wrapInstruction(new IndexInsnNode(InsnType.SGET, f.getFieldInfo(), 0));
}
}
}
}
}
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册