JumpInsnNode jmp = (JumpInsnNode) insn; convertJumpInsn(jmp); int op = jmp.getOpcode(); if (op == JSR) { throw new UnsupportedOperationException("JSR!");
private void convertJumpInsn(JumpInsnNode insn) { int op = insn.getOpcode(); if (op == GOTO) { if (!units.containsKey(insn)) {
switch (jumpNode.getOpcode()) { case Opcodes.IFEQ: case Opcodes.IFNE: case Opcodes.IFGT: case Opcodes.IFLE: TransformationStatistics.insertPush(jumpNode.getOpcode()); this.booleanTestabilityTransformation.insertPush(jumpNode.getOpcode(), jumpNode, mn.instructions); break; case Opcodes.IF_ICMPEQ: case Opcodes.IF_ICMPGT: case Opcodes.IF_ICMPLE: TransformationStatistics.insertPush(jumpNode.getOpcode()); this.booleanTestabilityTransformation.insertPush2(jumpNode.getOpcode(), jumpNode, mn.instructions); break; case Opcodes.IFNULL: case Opcodes.IFNONNULL: TransformationStatistics.insertPush(jumpNode.getOpcode()); this.booleanTestabilityTransformation.insertPushNull(jumpNode.getOpcode(), jumpNode, mn.instructions); break; case Opcodes.IF_ACMPEQ: case Opcodes.IF_ACMPNE: TransformationStatistics.insertPush(jumpNode.getOpcode()); this.booleanTestabilityTransformation.insertPushEquals(jumpNode.getOpcode(), jumpNode, mn.instructions); break; default:
/** {@inheritDoc} */ @Override public List<Mutation> apply(MethodNode mn, String className, String methodName, BytecodeInstruction instruction, Frame frame) { List<Mutation> mutations = new LinkedList<Mutation>(); JumpInsnNode node = (JumpInsnNode) instruction.getASMNode(); LabelNode target = node.label; // insert mutation into bytecode with conditional JumpInsnNode mutation = new JumpInsnNode(getOpposite(node.getOpcode()), target); // insert mutation into pool Mutation mutationObject = MutationPool.addMutation(className, methodName, NAME, instruction, mutation, Mutation.getDefaultInfectionDistance()); mutations.add(mutationObject); return mutations; }
} else if (ai instanceof JumpInsnNode) { JumpInsnNode n = ((JumpInsnNode)ai); writer.write("\n\t\t\t\tjump(" + n.getOpcode() + ", " + getLabelIndex(n.label) + ")"); } else if (ai instanceof LabelNode) { LabelNode n = ((LabelNode)ai);
for (Integer op : getOperators(node.getOpcode(), isBoolean)) { logger.debug("Adding replacement " + op); if (op >= 0) { methodName, NAME + " " + getOp(node.getOpcode()) + " -> " + getOp(op), instruction, mutation, getInfectionDistance(node.getOpcode(), op)); mutations.add(mutationObject); if (opcodesInt.contains(node.getOpcode())) mutation.add(new InsnNode(Opcodes.POP)); else methodName, NAME + " " + getOp(node.getOpcode()) + " -> " + op, instruction, mutation, getInfectionDistance(node.getOpcode(), op)); mutations.add(mutationObject);
@Override protected AbstractInsnNode transformJumpInsnNode(MethodNode mn, JumpInsnNode jumpNode) { if (jumpNode.getOpcode() == Opcodes.IFNE) { if (this.booleanTestabilityTransformation.isBooleanOnStack(mn, jumpNode, 0)) { TransformationStatistics.transformedBooleanComparison(); } else if (jumpNode.getOpcode() == Opcodes.IFEQ) { if (this.booleanTestabilityTransformation.isBooleanOnStack(mn, jumpNode, 0)) { TransformationStatistics.transformedBooleanComparison(); } else if (jumpNode.getOpcode() == Opcodes.IF_ICMPEQ) { if (this.booleanTestabilityTransformation.isBooleanOnStack(mn, jumpNode, 0)) { InsnList convert = new InsnList(); TransformationStatistics.transformedBooleanComparison(); } else if (jumpNode.getOpcode() == Opcodes.IF_ICMPNE) { if (this.booleanTestabilityTransformation.isBooleanOnStack(mn, jumpNode, 0)) { InsnList convert = new InsnList();
JumpInsnNode jumpInsn = (JumpInsnNode) nextInsn; boolean doJump = false; switch (jumpInsn.getOpcode()) { case Opcodes.IFEQ: if (testValue == null && isIntValue(value)) {
JumpInsnNode jumpInsn = (JumpInsnNode) nextNextInsn; boolean doJump = false; switch (jumpInsn.getOpcode()) { case Opcodes.IFEQ: if (isFloatValue(value)) {