本文整理匯總了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;
}