本文整理匯總了Java中org.objectweb.asm.tree.FieldInsnNode.opcode方法的典型用法代碼示例。如果您正苦於以下問題:Java FieldInsnNode.opcode方法的具體用法?Java FieldInsnNode.opcode怎麽用?Java FieldInsnNode.opcode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.objectweb.asm.tree.FieldInsnNode
的用法示例。
在下文中一共展示了FieldInsnNode.opcode方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: find
import org.objectweb.asm.tree.FieldInsnNode; //導入方法依賴的package包/類
@Override
public List<FieldHook> find(ClassNode cn) {
List<FieldHook> list = new ArrayList<FieldHook>();
MethodNode mn = cn.getMethodByName("toString");
int n = 0;
for (AbstractInsnNode ain : mn.instructions.toArray()) {
if (!(ain instanceof FieldInsnNode))
continue;
FieldInsnNode fin = (FieldInsnNode) ain;
if (fin.opcode() != GETFIELD)
continue;
switch (n) {
case 0:
list.add(asFieldHook(fin, "rx"));
break;
case 1:
list.add(asFieldHook(fin, "ry"));
break;
case 2:
list.add(asFieldHook(fin, "x"));
break;
case 3:
list.add(asFieldHook(fin, "y"));
break;
case 4:
list.add(asFieldHook(fin, "z"));
break;
default:
break;
}
n++;
}
return list;
}
示例2: getTreeSize
import org.objectweb.asm.tree.FieldInsnNode; //導入方法依賴的package包/類
public static TreeSize getTreeSize(AbstractInsnNode ain) {
int c = 0, p = 0;
if (ain instanceof InsnNode || ain instanceof IntInsnNode || ain instanceof VarInsnNode
|| ain instanceof JumpInsnNode || ain instanceof TableSwitchInsnNode
|| ain instanceof LookupSwitchInsnNode) {
c = CDS[ain.opcode()];
p = PDS[ain.opcode()];
} else if (ain instanceof FieldInsnNode) {
FieldInsnNode fin = (FieldInsnNode) ain;
char d = fin.desc.charAt(0);
switch (fin.opcode()) {
case GETFIELD: {
c = 1;
p = d == 'D' || d == 'J' ? 2 : 1;
break;
}
case GETSTATIC: {
c = 0;
p = d == 'D' || d == 'J' ? 2 : 1;
break;
}
case PUTFIELD: {
c = d == 'D' || d == 'J' ? 3 : 2;
p = 0;
break;
}
case PUTSTATIC: {
c = d == 'D' || d == 'J' ? 2 : 1;
p = 0;
break;
}
default: {
c = 0;
p = 0;
break;
}
}
} else if (ain instanceof MethodInsnNode) {
MethodInsnNode min = (MethodInsnNode) ain;
int as = Type.getArgumentsAndReturnSizes(min.desc);
c = (as >> 2) - (min.opcode() == INVOKEDYNAMIC || min.opcode() == INVOKESTATIC ? 1 : 0);
p = as & 0x03;
} else if (ain instanceof LdcInsnNode) {
Object cst = ((LdcInsnNode) ain).cst;
p = cst instanceof Double || cst instanceof Long ? 2 : 1;
} else if (ain instanceof MultiANewArrayInsnNode) {
c = ((MultiANewArrayInsnNode) ain).dims;
p = 1;
}
return new TreeSize(c, p);
}