Package org.pitest.bytecode.analysis
Class InstructionMatchers
- java.lang.Object
-
- org.pitest.bytecode.analysis.InstructionMatchers
-
public class InstructionMatchers extends Object
-
-
Constructor Summary
Constructors Constructor Description InstructionMatchers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Match<org.objectweb.asm.tree.AbstractInsnNode>aConditionalJump()static Match<org.objectweb.asm.tree.AbstractInsnNode>aConditionalJumpTo(Slot<org.objectweb.asm.tree.LabelNode> label)static Match<org.objectweb.asm.tree.AbstractInsnNode>aJump()static Match<org.objectweb.asm.tree.AbstractInsnNode>aLabelNode(SlotWrite<org.objectweb.asm.tree.LabelNode> slot)static Match<org.objectweb.asm.tree.AbstractInsnNode>anILoad(SlotWrite<Integer> counterVariable)static Match<org.objectweb.asm.tree.AbstractInsnNode>anILoadOf(SlotRead<Integer> counterVariable)static Match<org.objectweb.asm.tree.AbstractInsnNode>anIntegerConstant()static Match<org.objectweb.asm.tree.AbstractInsnNode>anIStore(SlotWrite<Integer> counterVariable)static Match<org.objectweb.asm.tree.AbstractInsnNode>anIStoreTo(SlotRead<Integer> counterVariable)static Match<org.objectweb.asm.tree.AbstractInsnNode>anyInstruction()static Match<org.objectweb.asm.tree.AbstractInsnNode>aVariableAccess(SlotWrite<Integer> counterVariable)static Match<org.objectweb.asm.tree.AbstractInsnNode>debug(String msg)static Match<org.objectweb.asm.tree.AbstractInsnNode>getStatic(String owner, String field)static Match<org.objectweb.asm.tree.AbstractInsnNode>gotoLabel(SlotWrite<org.objectweb.asm.tree.LabelNode> loopEnd)static Match<org.objectweb.asm.tree.AbstractInsnNode>incrementsVariable(SlotRead<Integer> counterVariable)static <T extends org.objectweb.asm.tree.AbstractInsnNode>
Match<org.objectweb.asm.tree.AbstractInsnNode>isA(Class<T> cls)static Match<org.objectweb.asm.tree.AbstractInsnNode>isInstruction(SlotRead<org.objectweb.asm.tree.AbstractInsnNode> target)static Match<org.objectweb.asm.tree.AbstractInsnNode>jumpsTo(SlotRead<org.objectweb.asm.tree.LabelNode> loopStart)static Match<org.objectweb.asm.tree.AbstractInsnNode>jumpsTo(SlotWrite<org.objectweb.asm.tree.LabelNode> label)static Match<org.objectweb.asm.tree.AbstractInsnNode>labelNode(SlotRead<org.objectweb.asm.tree.LabelNode> loopEnd)static Match<org.objectweb.asm.tree.AbstractInsnNode>ldcString(Predicate<String> match)static Match<org.objectweb.asm.tree.AbstractInsnNode>methodCall()static Match<org.objectweb.asm.tree.AbstractInsnNode>methodCallNamed(String name)static Match<org.objectweb.asm.tree.AbstractInsnNode>methodCallThatReturns(ClassName type)static Match<org.objectweb.asm.tree.AbstractInsnNode>methodCallTo(ClassName owner, String name)static Match<org.objectweb.asm.tree.AbstractInsnNode>methodCallTo(ClassName owner, Predicate<String> name)static Match<org.objectweb.asm.tree.AbstractInsnNode>methodDescEquals(String desc)static Match<org.objectweb.asm.tree.AbstractInsnNode>newCall(ClassName target)static Match<org.objectweb.asm.tree.AbstractInsnNode>notAnInstruction()Matches nodes that do not represent an instruction or labelstatic Match<org.objectweb.asm.tree.AbstractInsnNode>opCode(int opcode)static Match<org.objectweb.asm.tree.AbstractInsnNode>recordTarget(SlotRead<org.objectweb.asm.tree.AbstractInsnNode> target, SlotWrite<Boolean> found)Records if a instruction matches the target, but always returns truestatic Match<org.objectweb.asm.tree.AbstractInsnNode>variableMatches(SlotRead<Integer> counterVariable)static <T extends org.objectweb.asm.tree.AbstractInsnNode>
Match<org.objectweb.asm.tree.AbstractInsnNode>writeNodeToSlot(SlotWrite<T> slot, Class<T> clazz)
-
-
-
Method Detail
-
anyInstruction
public static Match<org.objectweb.asm.tree.AbstractInsnNode> anyInstruction()
-
notAnInstruction
public static Match<org.objectweb.asm.tree.AbstractInsnNode> notAnInstruction()
Matches nodes that do not represent an instruction or label
-
ldcString
public static Match<org.objectweb.asm.tree.AbstractInsnNode> ldcString(Predicate<String> match)
-
opCode
public static Match<org.objectweb.asm.tree.AbstractInsnNode> opCode(int opcode)
-
isA
public static <T extends org.objectweb.asm.tree.AbstractInsnNode> Match<org.objectweb.asm.tree.AbstractInsnNode> isA(Class<T> cls)
-
incrementsVariable
public static Match<org.objectweb.asm.tree.AbstractInsnNode> incrementsVariable(SlotRead<Integer> counterVariable)
-
anIStore
public static Match<org.objectweb.asm.tree.AbstractInsnNode> anIStore(SlotWrite<Integer> counterVariable)
-
anILoad
public static Match<org.objectweb.asm.tree.AbstractInsnNode> anILoad(SlotWrite<Integer> counterVariable)
-
aVariableAccess
public static Match<org.objectweb.asm.tree.AbstractInsnNode> aVariableAccess(SlotWrite<Integer> counterVariable)
-
anIStoreTo
public static Match<org.objectweb.asm.tree.AbstractInsnNode> anIStoreTo(SlotRead<Integer> counterVariable)
-
anILoadOf
public static Match<org.objectweb.asm.tree.AbstractInsnNode> anILoadOf(SlotRead<Integer> counterVariable)
-
variableMatches
public static Match<org.objectweb.asm.tree.AbstractInsnNode> variableMatches(SlotRead<Integer> counterVariable)
-
anIntegerConstant
public static Match<org.objectweb.asm.tree.AbstractInsnNode> anIntegerConstant()
-
aLabelNode
public static Match<org.objectweb.asm.tree.AbstractInsnNode> aLabelNode(SlotWrite<org.objectweb.asm.tree.LabelNode> slot)
-
aJump
public static Match<org.objectweb.asm.tree.AbstractInsnNode> aJump()
-
aConditionalJump
public static Match<org.objectweb.asm.tree.AbstractInsnNode> aConditionalJump()
-
aConditionalJumpTo
public static Match<org.objectweb.asm.tree.AbstractInsnNode> aConditionalJumpTo(Slot<org.objectweb.asm.tree.LabelNode> label)
-
writeNodeToSlot
public static <T extends org.objectweb.asm.tree.AbstractInsnNode> Match<org.objectweb.asm.tree.AbstractInsnNode> writeNodeToSlot(SlotWrite<T> slot, Class<T> clazz)
-
methodCallThatReturns
public static Match<org.objectweb.asm.tree.AbstractInsnNode> methodCallThatReturns(ClassName type)
-
methodCall
public static Match<org.objectweb.asm.tree.AbstractInsnNode> methodCall()
-
methodCallNamed
public static Match<org.objectweb.asm.tree.AbstractInsnNode> methodCallNamed(String name)
-
methodDescEquals
public static Match<org.objectweb.asm.tree.AbstractInsnNode> methodDescEquals(String desc)
-
methodCallTo
public static Match<org.objectweb.asm.tree.AbstractInsnNode> methodCallTo(ClassName owner, String name)
-
methodCallTo
public static Match<org.objectweb.asm.tree.AbstractInsnNode> methodCallTo(ClassName owner, Predicate<String> name)
-
isInstruction
public static Match<org.objectweb.asm.tree.AbstractInsnNode> isInstruction(SlotRead<org.objectweb.asm.tree.AbstractInsnNode> target)
-
getStatic
public static Match<org.objectweb.asm.tree.AbstractInsnNode> getStatic(String owner, String field)
-
recordTarget
public static Match<org.objectweb.asm.tree.AbstractInsnNode> recordTarget(SlotRead<org.objectweb.asm.tree.AbstractInsnNode> target, SlotWrite<Boolean> found)
Records if a instruction matches the target, but always returns true
-
jumpsTo
public static Match<org.objectweb.asm.tree.AbstractInsnNode> jumpsTo(SlotRead<org.objectweb.asm.tree.LabelNode> loopStart)
-
jumpsTo
public static Match<org.objectweb.asm.tree.AbstractInsnNode> jumpsTo(SlotWrite<org.objectweb.asm.tree.LabelNode> label)
-
gotoLabel
public static Match<org.objectweb.asm.tree.AbstractInsnNode> gotoLabel(SlotWrite<org.objectweb.asm.tree.LabelNode> loopEnd)
-
labelNode
public static Match<org.objectweb.asm.tree.AbstractInsnNode> labelNode(SlotRead<org.objectweb.asm.tree.LabelNode> loopEnd)
-
-