Class LoadStoreMatching

java.lang.Object
net.covers1624.coffeegrinder.bytecode.matching.LoadStoreMatching

public class LoadStoreMatching extends Object
Created by covers1624 on 19/4/21.
  • Constructor Details

    • LoadStoreMatching

      public LoadStoreMatching()
  • Method Details

    • matchStoreLocalLoadLocal

      @Nullable public static @Nullable Store matchStoreLocalLoadLocal(@Nullable @Nullable Instruction insn, LocalVariable variable)
      Matches the given instruction to a Store instruction, whose child is a Load instruction of a specific variable.
      Parameters:
      insn - The insn to match against.
      variable - The variable to match against.
      Returns:
      The Store instruction or null
    • matchLocalRef

      @Nullable public static @Nullable LocalReference matchLocalRef(@Nullable @Nullable Instruction insn, LocalVariable variable)
    • matchLoadLocal

      @Nullable @Contract("null->null") public static @Nullable Load matchLoadLocal(@Nullable @Nullable Instruction insn)
      Matches the given instruction to a Load instruction.
      Parameters:
      insn - The insn to match against.
      Returns:
      The Load instruction.
    • matchLoadLocal

      @Nullable public static @Nullable Load matchLoadLocal(@Nullable @Nullable Instruction insn, LocalVariable variable)
      Matches the given instruction to a Load instruction of a specific variable.
      Parameters:
      insn - The insn to match against.
      variable - The variable to match against.
      Returns:
      The Load instruction.
    • matchStoreLocal

      @Nullable public static @Nullable Store matchStoreLocal(@Nullable @Nullable Instruction insn)
      Matches the given instruction to a Store instruction.
      Parameters:
      insn - The insn to match against.
      Returns:
      The Store instruction.
    • matchStoreLocal

      @Nullable public static @Nullable Store matchStoreLocal(@Nullable @Nullable Instruction insn, LocalVariable variable)
      Matches the given instruction to a Store instruction of a specific variable.
      Parameters:
      insn - The insn to match against.
      variable - The variable to match against.
      Returns:
      The Store instruction.
    • matchFieldRef

      @Nullable public static @Nullable FieldReference matchFieldRef(@Nullable @Nullable Instruction insn, Field field)
    • matchLoadField

      @Nullable public static @Nullable Load matchLoadField(@Nullable @Nullable Instruction insn)
      Matches the given instruction to a LoadField of the given field.
      Parameters:
      insn - The instruction to match.
      Returns:
      The LoadField or null.
    • matchLoadField

      @Nullable public static @Nullable Load matchLoadField(@Nullable @Nullable Instruction insn, Field field)
      Matches the given instruction to a LoadField of the given field.
      Parameters:
      insn - The instruction to match.
      field - The field to match.
      Returns:
      The LoadField or null.
    • matchLoadFieldRef

      @Nullable public static @Nullable FieldReference matchLoadFieldRef(@Nullable @Nullable Instruction insn)
    • matchStoreFieldRef

      @Nullable public static @Nullable FieldReference matchStoreFieldRef(@Nullable @Nullable Instruction insn)
    • matchStoreField

      @Nullable public static @Nullable Store matchStoreField(@Nullable @Nullable Instruction insn)
      Matches the given instruction to a StoreField of the given field.
      Parameters:
      insn - The instruction to match.
      Returns:
      The StoreField or null.
    • matchStoreField

      @Nullable @Contract("null,_->null") public static @Nullable Store matchStoreField(@Nullable @Nullable Instruction insn, Field field)
      Matches the given instruction to a StoreField of the given field.
      Parameters:
      insn - The instruction to match.
      field - The field to match.
      Returns:
      The StoreField or null.
    • matchField

      public static boolean matchField(Field field1, Field field2)
    • equivalentFieldDescriptors

      public static boolean equivalentFieldDescriptors(Field field1, Field field2)
    • matchArrayLenLoad

      @Nullable public static @Nullable ArrayLen matchArrayLenLoad(@Nullable @Nullable Instruction insn, LocalVariable loadVar)
      Matches the given instruction to an ArrayLen instruction which contains a Load of the given variable.
      Parameters:
      insn - The insn to match against.
      loadVar - The variable loaded by the ArrayLen target.
      Returns:
      The ArrayLen instruction.
    • matchLoadElemRef

      @Nullable public static @Nullable ArrayElementReference matchLoadElemRef(@Nullable @Nullable Instruction insn)