/** * Returns whether the given instruction is an invoke-static instruction. */ private static boolean isInvokeStaticInstruction(CstInsn cstInsn) { final Dop[] staticInvokeInstructions= { Dops.INVOKE_STATIC, Dops.INVOKE_STATIC_RANGE }; for (Dop dop : staticInvokeInstructions) { if (dop.equals(cstInsn.getOpcode())) { return true; } } return false; }
/** * Returns whether the given instruction is an invoke instruction that can * be handled by {@link #processInvokeInstruction(CstInsn)}. */ private static boolean isInvokeInstruction(CstInsn cstInsn) { final Dop[] invokeInstructions= { Dops.INVOKE_VIRTUAL, Dops.INVOKE_VIRTUAL_RANGE, Dops.INVOKE_STATIC, Dops.INVOKE_STATIC_RANGE, Dops.INVOKE_DIRECT, Dops.INVOKE_DIRECT_RANGE, Dops.INVOKE_INTERFACE, Dops.INVOKE_INTERFACE_RANGE, Dops.INVOKE_SUPER, Dops.INVOKE_SUPER_RANGE }; for (Dop dop : invokeInstructions) { if (dop.equals(cstInsn.getOpcode())) { return true; } } return false; }
/** * Returns whether the given instruction is an invoke instruction that can * be handled by {@link #processInvokeInstruction(CstInsn)}. */ private static boolean isInvokeInstruction(CstInsn cstInsn) { final Dop[] invokeInstructions= { Dops.INVOKE_VIRTUAL, Dops.INVOKE_VIRTUAL_RANGE, Dops.INVOKE_STATIC, Dops.INVOKE_STATIC_RANGE, Dops.INVOKE_DIRECT, Dops.INVOKE_DIRECT_RANGE, Dops.INVOKE_INTERFACE, Dops.INVOKE_INTERFACE_RANGE, Dops.INVOKE_SUPER, Dops.INVOKE_SUPER_RANGE }; for (Dop dop : invokeInstructions) { if (dop.equals(cstInsn.getOpcode())) { return true; } } return false; }
/** {@inheritDoc} */ @Override public DalvInsn withRegisters(RegisterSpecList registers) { CstInsn result = new CstInsn(getOpcode(), getPosition(), registers, constant); if (index >= 0) { result.setIndex(index); } if (classIndex >= 0) { result.setClassIndex(classIndex); } return result; }
/** {@inheritDoc} */ @Override public DalvInsn withRegisters(RegisterSpecList registers) { CstInsn result = new CstInsn(getOpcode(), getPosition(), registers, constant); if (index >= 0) { result.setIndex(index); } if (classIndex >= 0) { result.setClassIndex(classIndex); } return result; }
/** {@inheritDoc} */ @Override public DalvInsn withRegisters(RegisterSpecList registers) { CstInsn result = new CstInsn(getOpcode(), getPosition(), registers, constant); if (index >= 0) { result.setIndex(index); } if (classIndex >= 0) { result.setClassIndex(classIndex); } return result; }
/** {@inheritDoc} */ @Override public DalvInsn withRegisters(RegisterSpecList registers) { CstInsn result = new CstInsn(getOpcode(), getPosition(), registers, constant); if (index >= 0) { result.setIndex(index); } if (classIndex >= 0) { result.setClassIndex(classIndex); } return result; }
/** {@inheritDoc} */ @Override public DalvInsn withRegisters(RegisterSpecList registers) { CstInsn result = new CstInsn(getOpcode(), getPosition(), registers, constant); if (index >= 0) { result.setIndex(index); } if (classIndex >= 0) { result.setClassIndex(classIndex); } return result; }
/** {@inheritDoc} */ @Override public DalvInsn withRegisters(RegisterSpecList registers) { CstInsn result = new CstInsn(getOpcode(), getPosition(), registers, constant); if (index >= 0) { result.setIndex(index); } if (classIndex >= 0) { result.setClassIndex(classIndex); } return result; }
/** {@inheritDoc} */ @Override public DalvInsn withRegisters(RegisterSpecList registers) { CstInsn result = new CstInsn(getOpcode(), getPosition(), registers, constant); if (index >= 0) { result.setIndex(index); } if (classIndex >= 0) { result.setClassIndex(classIndex); } return result; }
/** {@inheritDoc} */ @Override public DalvInsn withRegisters(RegisterSpecList registers) { CstInsn result = new CstInsn(getOpcode(), getPosition(), registers, constant); if (index >= 0) { result.setIndex(index); } if (classIndex >= 0) { result.setClassIndex(classIndex); } return result; }
Element result= new Element(sanitizeInstructionName(cstInsn.getOpcode().getName()), NS_DEX); CstBaseMethodRef methodRef= (CstBaseMethodRef) cstInsn.getConstant(); String classType= methodRef.getDefiningClass().toHuman();