Class InstructionMatchers


  • public class InstructionMatchers
    extends Object
    • Constructor Detail

      • InstructionMatchers

        public InstructionMatchers()
    • 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
      • newCall

        public static Match<org.objectweb.asm.tree.AbstractInsnNode> newCall​(ClassName target)
      • 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)
      • 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)
      • debug

        public static Match<org.objectweb.asm.tree.AbstractInsnNode> debug​(String msg)