Commit f7589dd4 authored by Lubomir Bulej's avatar Lubomir Bulej

Insn: add methods that check whether an instruction is a constant load or a

scalar load.
parent 8617be71
......@@ -298,4 +298,14 @@ public enum Insn {
return (insn.getOpcode() == -1);
}
public static boolean isConstLoad (final AbstractInsnNode insn) {
final int opcode = insn.getOpcode ();
return opcode >= Opcodes.ACONST_NULL && opcode <= Opcodes.LDC;
}
public static boolean isScalarLoad (final AbstractInsnNode insn) {
final int opcode = insn.getOpcode ();
return opcode >= Opcodes.ILOAD && opcode <= Opcodes.ALOAD;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment