public class InsnUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static @Nullable InsnNode |
checkInsnType(@Nullable InsnNode insn,
InsnType insnType) |
static <T extends InsnArg> |
containsVar(java.util.List<T> list,
RegisterArg arg) |
static boolean |
dontGenerateIfNotUsed(InsnNode insn) |
static java.lang.String |
formatOffset(int offset) |
static java.lang.Object |
getConstValueByArg(RootNode root,
InsnArg arg)
Search constant assigned to provided arg.
|
static @Nullable java.lang.Object |
getConstValueByInsn(RootNode root,
InsnNode insn)
Return constant value from insn or null if not constant.
|
static @Nullable RegisterArg |
getRegFromInsn(java.util.List<RegisterArg> regs,
InsnType insnType) |
static @Nullable InsnArg |
getSingleArg(InsnNode insn) |
static @Nullable InsnNode |
getWrappedInsn(InsnArg arg) |
static java.lang.String |
indexToString(java.lang.Object index) |
static java.lang.String |
insnTypeToString(InsnType type) |
static void |
replaceInsns(MethodNode mth,
java.util.function.Function<InsnNode,InsnNode> replaceFunction) |
static void |
replaceInsnsInInsn(MethodNode mth,
InsnNode insn,
java.util.function.Function<InsnNode,InsnNode> replaceFunction) |
static @Nullable InsnNode |
searchInsn(MethodNode mth,
InsnType insnType,
java.util.function.Predicate<InsnNode> test)
Search instruction of specific type and condition in method.
|
static @Nullable InsnNode |
searchSingleReturnInsn(MethodNode mth,
java.util.function.Predicate<InsnNode> test) |
public static java.lang.String formatOffset(int offset)
public static java.lang.String insnTypeToString(InsnType type)
public static java.lang.String indexToString(java.lang.Object index)
public static java.lang.Object getConstValueByArg(RootNode root, InsnArg arg)
@Nullable public static @Nullable java.lang.Object getConstValueByInsn(RootNode root, InsnNode insn)
@Nullable public static @Nullable InsnNode searchSingleReturnInsn(MethodNode mth, java.util.function.Predicate<InsnNode> test)
@Nullable public static @Nullable InsnNode searchInsn(MethodNode mth, InsnType insnType, java.util.function.Predicate<InsnNode> test)
public static void replaceInsns(MethodNode mth, java.util.function.Function<InsnNode,InsnNode> replaceFunction)
public static void replaceInsnsInInsn(MethodNode mth, InsnNode insn, java.util.function.Function<InsnNode,InsnNode> replaceFunction)
@Nullable public static @Nullable RegisterArg getRegFromInsn(java.util.List<RegisterArg> regs, InsnType insnType)
@Nullable public static @Nullable InsnNode checkInsnType(@Nullable @Nullable InsnNode insn, InsnType insnType)
public static boolean dontGenerateIfNotUsed(InsnNode insn)
public static <T extends InsnArg> boolean containsVar(java.util.List<T> list, RegisterArg arg)