Class LoadStoreMatching
java.lang.Object
net.covers1624.coffeegrinder.bytecode.matching.LoadStoreMatching
Created by covers1624 on 19/4/21.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanequivalentFieldDescriptors(Field field1, Field field2) static @Nullable ArrayLenmatchArrayLen(@Nullable Instruction insn) Matches the given instruction to anArrayLeninstruction.static @Nullable ArrayLenmatchArrayLenLoad(@Nullable Instruction insn, LocalVariable loadVar) static @Nullable ArrayElementReferencematchElemRef(@Nullable Instruction insn) static booleanmatchField(Field field1, Field field2) static @Nullable FieldReferencematchFieldRef(@Nullable Instruction insn) static @Nullable FieldReferencematchFieldRef(@Nullable Instruction insn, Field field) static @Nullable LoadmatchLoad(@Nullable Instruction insn) Matches the given instruction to a Load instruction.static @Nullable ArrayElementReferencematchLoadElemRef(@Nullable Instruction insn) static @Nullable LoadmatchLoadField(@Nullable Instruction insn) Matches the given instruction to a LoadField of the given field.static @Nullable LoadmatchLoadField(@Nullable Instruction insn, Field field) Matches the given instruction to a LoadField of the given field.static @Nullable FieldReferencematchLoadFieldRef(@Nullable Instruction insn) static @Nullable LoadmatchLoadLocal(@Nullable Instruction insn) Matches the given instruction to a Load instruction.static @Nullable LoadmatchLoadLocal(@Nullable Instruction insn, LocalVariable variable) Matches the given instruction to a Load instruction of a specific variable.static @Nullable LocalReferencematchLocalRef(@Nullable Instruction insn) static @Nullable LocalReferencematchLocalRef(@Nullable Instruction insn, LocalVariable variable) static @Nullable StorematchStore(@Nullable Instruction insn) Matches the given instruction to a Store instruction.static @Nullable StorematchStoreField(@Nullable Instruction insn) Matches the given instruction to a StoreField of the given field.static @Nullable StorematchStoreField(@Nullable Instruction insn, Field field) Matches the given instruction to a StoreField of the given field.static @Nullable FieldReferencematchStoreFieldRef(@Nullable Instruction insn) static @Nullable StorematchStoreLocal(@Nullable Instruction insn) Matches the given instruction to a Store instruction.static @Nullable StorematchStoreLocal(@Nullable Instruction insn, LocalVariable variable) Matches the given instruction to a Store instruction of a specific variable.static @Nullable StorematchStoreLocalLoadLocal(@Nullable Instruction insn, LocalVariable variable)
-
Constructor Details
-
LoadStoreMatching
public LoadStoreMatching()
-
-
Method Details
-
matchLoad
Matches the given instruction to a Load instruction.- Parameters:
insn- The insn to match against.- Returns:
- The Load instruction.
-
matchStore
Matches the given instruction to a Store instruction.- Parameters:
insn- The insn to match against.- Returns:
- The Store instruction.
-
matchStoreLocalLoadLocal
@Nullable public static @Nullable Store matchStoreLocalLoadLocal(@Nullable @Nullable Instruction insn, LocalVariable variable) Matches the given instruction to aStoreinstruction, whose child is aLoadinstruction of a specific variable.- Parameters:
insn- The insn to match against.variable- The variable to match against.- Returns:
- The
Storeinstruction ornull
-
matchLocalRef
@Nullable public static @Nullable LocalReference matchLocalRef(@Nullable @Nullable Instruction insn) -
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
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) -
matchFieldRef
@Nullable public static @Nullable FieldReference matchFieldRef(@Nullable @Nullable Instruction insn, Field field) -
matchLoadField
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
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
-
equivalentFieldDescriptors
-
matchArrayLen
Matches the given instruction to anArrayLeninstruction.- Parameters:
insn- The insn to match against.- Returns:
- The
ArrayLeninstruction.
-
matchArrayLenLoad
@Nullable public static @Nullable ArrayLen matchArrayLenLoad(@Nullable @Nullable Instruction insn, LocalVariable loadVar) -
matchElemRef
@Nullable public static @Nullable ArrayElementReference matchElemRef(@Nullable @Nullable Instruction insn) -
matchLoadElemRef
@Nullable public static @Nullable ArrayElementReference matchLoadElemRef(@Nullable @Nullable Instruction insn)
-