本文整理汇总了Java中org.jf.dexlib2.immutable.debug.ImmutableStartLocal类的典型用法代码示例。如果您正苦于以下问题:Java ImmutableStartLocal类的具体用法?Java ImmutableStartLocal怎么用?Java ImmutableStartLocal使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ImmutableStartLocal类属于org.jf.dexlib2.immutable.debug包,在下文中一共展示了ImmutableStartLocal类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildLocalInfo
import org.jf.dexlib2.immutable.debug.ImmutableStartLocal; //导入依赖的package包/类
private static LocalInfo buildLocalInfo(DexBackedMethod dexBackedMethod) {
LocalInfo info = new LocalInfo();
int insSize = getInsSize(dexBackedMethod);
List<? extends MethodParameter> parameters = dexBackedMethod.getParameters();
int argReg = getRegisterSize(dexBackedMethod) - insSize;//reg = resiter - ins
// System.out.println("registerCount:" + methodImplementation.getRegisterCount());
boolean isStatic = AccessFlags.STATIC.isSet(dexBackedMethod.getAccessFlags());
if (!isStatic) {
info.setName(argReg, "this");
argReg++;
}
for (MethodParameter p : parameters) {
int reg = argReg;
if ("D".equals(p.getType()) || "J".equals(p.getType())) {
argReg += 2;
} else {
argReg += 1;
}
if (!Strings.isNullOrEmpty(p.getName())) {
info.setName(reg, p.getName());
}
// System.out.println("pararms:====" + p.getName() + ",paramRegister:" + reg);
}
DexBackedMethodImplementation implementation = dexBackedMethod.getImplementation();
if (implementation != null) {
Iterable<? extends DebugItem> debugItems = implementation.getDebugItems();
for (DebugItem debugItem : debugItems) {
if (debugItem.getDebugItemType() == DebugItemType.START_LOCAL) {
// System.out.println(
// "debugItemStartLocal:====" + ((ImmutableStartLocal) debugItem).getName() + ",register:"
// + ((ImmutableStartLocal) debugItem).getRegister());
info.setName(((ImmutableStartLocal) debugItem).getRegister(),
((ImmutableStartLocal) debugItem).getName());
}
if (debugItem.getDebugItemType() == DebugItemType.START_LOCAL_EXTENDED) {
// System.out.println(
// "debugItemStartLocalExt:====" + ((ImmutableStartLocal) debugItem).getName() + ",register:"
// + ((ImmutableStartLocal) debugItem).getRegister());
info.setName(((ImmutableStartLocal) debugItem).getRegister(),
((ImmutableStartLocal) debugItem).getName());
}
}
}
return info;
}