Last active
November 1, 2016 20:47
-
-
Save CalebWhiting/73563a32fb09cc04cae95ddae845a4ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.rsxml.handler.analysis; | |
import com.rsxml.*; | |
import com.rsxml.attr.*; | |
import com.rsxml.attr.Attribute; | |
import com.rsxml.util.TypeUtils; | |
import org.objectweb.asm.*; | |
import org.objectweb.asm.tree.*; | |
import java.util.function.*; | |
/* AUTOMATICALLY GENERATED DATA */ | |
public abstract class BasicPatternNode implements Predicate<AbstractInsnNode> { | |
@Attribute(value="parent") BasicPattern parent; | |
@Attribute(value="context") XMLContext context; | |
@Attribute(value="id", dflt="") String id; | |
@Start | |
private void addPatternNode() { | |
parent.pattern.add(this); | |
} | |
@Handler(value="WILDCARD", parent = BasicPattern.class) | |
static class WILDCARD extends BasicPatternNode { | |
@Attribute(value = "type", dflt = "", values = { | |
"INSN", "INT", "VAR", "TYPE", "FIELD", "METHOD", | |
"INVOKE_DYNAMIC", "JUMP", "LABEL", "LDC", "IINC", | |
"TABLESWITCH", "LOOKUPSWITCH", "MULTIANEWARRAY", "FRAME", "LINE" | |
}) | |
String type; | |
public boolean test(AbstractInsnNode node) { | |
return type.isEmpty() || node.getType() == InsnUtils.getTypeForName(type); | |
} | |
} | |
@Handler(value="NOP", parent = BasicPattern.class) | |
static class NOP extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.NOP; | |
} | |
} | |
@Handler(value="ACONST_NULL", parent = BasicPattern.class) | |
static class ACONST_NULL extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ACONST_NULL; | |
} | |
} | |
@Handler(value="ICONST_M1", parent = BasicPattern.class) | |
static class ICONST_M1 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ICONST_M1; | |
} | |
} | |
@Handler(value="ICONST_0", parent = BasicPattern.class) | |
static class ICONST_0 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ICONST_0; | |
} | |
} | |
@Handler(value="ICONST_1", parent = BasicPattern.class) | |
static class ICONST_1 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ICONST_1; | |
} | |
} | |
@Handler(value="ICONST_2", parent = BasicPattern.class) | |
static class ICONST_2 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ICONST_2; | |
} | |
} | |
@Handler(value="ICONST_3", parent = BasicPattern.class) | |
static class ICONST_3 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ICONST_3; | |
} | |
} | |
@Handler(value="ICONST_4", parent = BasicPattern.class) | |
static class ICONST_4 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ICONST_4; | |
} | |
} | |
@Handler(value="ICONST_5", parent = BasicPattern.class) | |
static class ICONST_5 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ICONST_5; | |
} | |
} | |
@Handler(value="LCONST_0", parent = BasicPattern.class) | |
static class LCONST_0 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LCONST_0; | |
} | |
} | |
@Handler(value="LCONST_1", parent = BasicPattern.class) | |
static class LCONST_1 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LCONST_1; | |
} | |
} | |
@Handler(value="FCONST_0", parent = BasicPattern.class) | |
static class FCONST_0 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FCONST_0; | |
} | |
} | |
@Handler(value="FCONST_1", parent = BasicPattern.class) | |
static class FCONST_1 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FCONST_1; | |
} | |
} | |
@Handler(value="FCONST_2", parent = BasicPattern.class) | |
static class FCONST_2 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FCONST_2; | |
} | |
} | |
@Handler(value="DCONST_0", parent = BasicPattern.class) | |
static class DCONST_0 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DCONST_0; | |
} | |
} | |
@Handler(value="DCONST_1", parent = BasicPattern.class) | |
static class DCONST_1 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DCONST_1; | |
} | |
} | |
@Handler(value="BIPUSH", parent = BasicPattern.class) | |
static class BIPUSH extends BasicPatternNode { | |
@Attribute(value="operand", dflt="") Integer operand; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.BIPUSH) { | |
return false; | |
} | |
IntInsnNode cast = (IntInsnNode) node; | |
if (operand != null && operand != cast.operand) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="SIPUSH", parent = BasicPattern.class) | |
static class SIPUSH extends BasicPatternNode { | |
@Attribute(value="operand", dflt="") Integer operand; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.SIPUSH) { | |
return false; | |
} | |
IntInsnNode cast = (IntInsnNode) node; | |
if (operand != null && operand != cast.operand) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="LDC", parent = BasicPattern.class) | |
static class LDC extends BasicPatternNode { | |
@Attribute(value="cst", dflt="") String cst; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.LDC) { | |
return false; | |
} | |
LdcInsnNode cast = (LdcInsnNode) node; | |
if (cst != null && !cst.equals(String.valueOf(cast.cst))) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="ILOAD", parent = BasicPattern.class) | |
static class ILOAD extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.ILOAD) { | |
return false; | |
} | |
VarInsnNode cast = (VarInsnNode) node; | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="LLOAD", parent = BasicPattern.class) | |
static class LLOAD extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.LLOAD) { | |
return false; | |
} | |
VarInsnNode cast = (VarInsnNode) node; | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="FLOAD", parent = BasicPattern.class) | |
static class FLOAD extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.FLOAD) { | |
return false; | |
} | |
VarInsnNode cast = (VarInsnNode) node; | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="DLOAD", parent = BasicPattern.class) | |
static class DLOAD extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.DLOAD) { | |
return false; | |
} | |
VarInsnNode cast = (VarInsnNode) node; | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="ALOAD", parent = BasicPattern.class) | |
static class ALOAD extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.ALOAD) { | |
return false; | |
} | |
VarInsnNode cast = (VarInsnNode) node; | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="IALOAD", parent = BasicPattern.class) | |
static class IALOAD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IALOAD; | |
} | |
} | |
@Handler(value="LALOAD", parent = BasicPattern.class) | |
static class LALOAD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LALOAD; | |
} | |
} | |
@Handler(value="FALOAD", parent = BasicPattern.class) | |
static class FALOAD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FALOAD; | |
} | |
} | |
@Handler(value="DALOAD", parent = BasicPattern.class) | |
static class DALOAD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DALOAD; | |
} | |
} | |
@Handler(value="AALOAD", parent = BasicPattern.class) | |
static class AALOAD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.AALOAD; | |
} | |
} | |
@Handler(value="BALOAD", parent = BasicPattern.class) | |
static class BALOAD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.BALOAD; | |
} | |
} | |
@Handler(value="CALOAD", parent = BasicPattern.class) | |
static class CALOAD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.CALOAD; | |
} | |
} | |
@Handler(value="SALOAD", parent = BasicPattern.class) | |
static class SALOAD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.SALOAD; | |
} | |
} | |
@Handler(value="ISTORE", parent = BasicPattern.class) | |
static class ISTORE extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.ISTORE) { | |
return false; | |
} | |
VarInsnNode cast = (VarInsnNode) node; | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="LSTORE", parent = BasicPattern.class) | |
static class LSTORE extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.LSTORE) { | |
return false; | |
} | |
VarInsnNode cast = (VarInsnNode) node; | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="FSTORE", parent = BasicPattern.class) | |
static class FSTORE extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.FSTORE) { | |
return false; | |
} | |
VarInsnNode cast = (VarInsnNode) node; | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="DSTORE", parent = BasicPattern.class) | |
static class DSTORE extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.DSTORE) { | |
return false; | |
} | |
VarInsnNode cast = (VarInsnNode) node; | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="ASTORE", parent = BasicPattern.class) | |
static class ASTORE extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.ASTORE) { | |
return false; | |
} | |
VarInsnNode cast = (VarInsnNode) node; | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="IASTORE", parent = BasicPattern.class) | |
static class IASTORE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IASTORE; | |
} | |
} | |
@Handler(value="LASTORE", parent = BasicPattern.class) | |
static class LASTORE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LASTORE; | |
} | |
} | |
@Handler(value="FASTORE", parent = BasicPattern.class) | |
static class FASTORE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FASTORE; | |
} | |
} | |
@Handler(value="DASTORE", parent = BasicPattern.class) | |
static class DASTORE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DASTORE; | |
} | |
} | |
@Handler(value="AASTORE", parent = BasicPattern.class) | |
static class AASTORE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.AASTORE; | |
} | |
} | |
@Handler(value="BASTORE", parent = BasicPattern.class) | |
static class BASTORE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.BASTORE; | |
} | |
} | |
@Handler(value="CASTORE", parent = BasicPattern.class) | |
static class CASTORE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.CASTORE; | |
} | |
} | |
@Handler(value="SASTORE", parent = BasicPattern.class) | |
static class SASTORE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.SASTORE; | |
} | |
} | |
@Handler(value="POP", parent = BasicPattern.class) | |
static class POP extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.POP; | |
} | |
} | |
@Handler(value="POP2", parent = BasicPattern.class) | |
static class POP2 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.POP2; | |
} | |
} | |
@Handler(value="DUP", parent = BasicPattern.class) | |
static class DUP extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DUP; | |
} | |
} | |
@Handler(value="DUP_X1", parent = BasicPattern.class) | |
static class DUP_X1 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DUP_X1; | |
} | |
} | |
@Handler(value="DUP_X2", parent = BasicPattern.class) | |
static class DUP_X2 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DUP_X2; | |
} | |
} | |
@Handler(value="DUP2", parent = BasicPattern.class) | |
static class DUP2 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DUP2; | |
} | |
} | |
@Handler(value="DUP2_X1", parent = BasicPattern.class) | |
static class DUP2_X1 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DUP2_X1; | |
} | |
} | |
@Handler(value="DUP2_X2", parent = BasicPattern.class) | |
static class DUP2_X2 extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DUP2_X2; | |
} | |
} | |
@Handler(value="SWAP", parent = BasicPattern.class) | |
static class SWAP extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.SWAP; | |
} | |
} | |
@Handler(value="IADD", parent = BasicPattern.class) | |
static class IADD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IADD; | |
} | |
} | |
@Handler(value="LADD", parent = BasicPattern.class) | |
static class LADD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LADD; | |
} | |
} | |
@Handler(value="FADD", parent = BasicPattern.class) | |
static class FADD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FADD; | |
} | |
} | |
@Handler(value="DADD", parent = BasicPattern.class) | |
static class DADD extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DADD; | |
} | |
} | |
@Handler(value="ISUB", parent = BasicPattern.class) | |
static class ISUB extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ISUB; | |
} | |
} | |
@Handler(value="LSUB", parent = BasicPattern.class) | |
static class LSUB extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LSUB; | |
} | |
} | |
@Handler(value="FSUB", parent = BasicPattern.class) | |
static class FSUB extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FSUB; | |
} | |
} | |
@Handler(value="DSUB", parent = BasicPattern.class) | |
static class DSUB extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DSUB; | |
} | |
} | |
@Handler(value="IMUL", parent = BasicPattern.class) | |
static class IMUL extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IMUL; | |
} | |
} | |
@Handler(value="LMUL", parent = BasicPattern.class) | |
static class LMUL extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LMUL; | |
} | |
} | |
@Handler(value="FMUL", parent = BasicPattern.class) | |
static class FMUL extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FMUL; | |
} | |
} | |
@Handler(value="DMUL", parent = BasicPattern.class) | |
static class DMUL extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DMUL; | |
} | |
} | |
@Handler(value="IDIV", parent = BasicPattern.class) | |
static class IDIV extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IDIV; | |
} | |
} | |
@Handler(value="LDIV", parent = BasicPattern.class) | |
static class LDIV extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LDIV; | |
} | |
} | |
@Handler(value="FDIV", parent = BasicPattern.class) | |
static class FDIV extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FDIV; | |
} | |
} | |
@Handler(value="DDIV", parent = BasicPattern.class) | |
static class DDIV extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DDIV; | |
} | |
} | |
@Handler(value="IREM", parent = BasicPattern.class) | |
static class IREM extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IREM; | |
} | |
} | |
@Handler(value="LREM", parent = BasicPattern.class) | |
static class LREM extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LREM; | |
} | |
} | |
@Handler(value="FREM", parent = BasicPattern.class) | |
static class FREM extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FREM; | |
} | |
} | |
@Handler(value="DREM", parent = BasicPattern.class) | |
static class DREM extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DREM; | |
} | |
} | |
@Handler(value="INEG", parent = BasicPattern.class) | |
static class INEG extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.INEG; | |
} | |
} | |
@Handler(value="LNEG", parent = BasicPattern.class) | |
static class LNEG extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LNEG; | |
} | |
} | |
@Handler(value="FNEG", parent = BasicPattern.class) | |
static class FNEG extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FNEG; | |
} | |
} | |
@Handler(value="DNEG", parent = BasicPattern.class) | |
static class DNEG extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DNEG; | |
} | |
} | |
@Handler(value="ISHL", parent = BasicPattern.class) | |
static class ISHL extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ISHL; | |
} | |
} | |
@Handler(value="LSHL", parent = BasicPattern.class) | |
static class LSHL extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LSHL; | |
} | |
} | |
@Handler(value="ISHR", parent = BasicPattern.class) | |
static class ISHR extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ISHR; | |
} | |
} | |
@Handler(value="LSHR", parent = BasicPattern.class) | |
static class LSHR extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LSHR; | |
} | |
} | |
@Handler(value="IUSHR", parent = BasicPattern.class) | |
static class IUSHR extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IUSHR; | |
} | |
} | |
@Handler(value="LUSHR", parent = BasicPattern.class) | |
static class LUSHR extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LUSHR; | |
} | |
} | |
@Handler(value="IAND", parent = BasicPattern.class) | |
static class IAND extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IAND; | |
} | |
} | |
@Handler(value="LAND", parent = BasicPattern.class) | |
static class LAND extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LAND; | |
} | |
} | |
@Handler(value="IOR", parent = BasicPattern.class) | |
static class IOR extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IOR; | |
} | |
} | |
@Handler(value="LOR", parent = BasicPattern.class) | |
static class LOR extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LOR; | |
} | |
} | |
@Handler(value="IXOR", parent = BasicPattern.class) | |
static class IXOR extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IXOR; | |
} | |
} | |
@Handler(value="LXOR", parent = BasicPattern.class) | |
static class LXOR extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LXOR; | |
} | |
} | |
@Handler(value="IINC", parent = BasicPattern.class) | |
static class IINC extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
@Attribute(value="incr", dflt="") Integer incr; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.IINC) { | |
return false; | |
} | |
IincInsnNode cast = (IincInsnNode) node; | |
if (incr != null && incr != cast.incr) { | |
return false; | |
} | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="I2L", parent = BasicPattern.class) | |
static class I2L extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.I2L; | |
} | |
} | |
@Handler(value="I2F", parent = BasicPattern.class) | |
static class I2F extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.I2F; | |
} | |
} | |
@Handler(value="I2D", parent = BasicPattern.class) | |
static class I2D extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.I2D; | |
} | |
} | |
@Handler(value="L2I", parent = BasicPattern.class) | |
static class L2I extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.L2I; | |
} | |
} | |
@Handler(value="L2F", parent = BasicPattern.class) | |
static class L2F extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.L2F; | |
} | |
} | |
@Handler(value="L2D", parent = BasicPattern.class) | |
static class L2D extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.L2D; | |
} | |
} | |
@Handler(value="F2I", parent = BasicPattern.class) | |
static class F2I extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.F2I; | |
} | |
} | |
@Handler(value="F2L", parent = BasicPattern.class) | |
static class F2L extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.F2L; | |
} | |
} | |
@Handler(value="F2D", parent = BasicPattern.class) | |
static class F2D extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.F2D; | |
} | |
} | |
@Handler(value="D2I", parent = BasicPattern.class) | |
static class D2I extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.D2I; | |
} | |
} | |
@Handler(value="D2L", parent = BasicPattern.class) | |
static class D2L extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.D2L; | |
} | |
} | |
@Handler(value="D2F", parent = BasicPattern.class) | |
static class D2F extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.D2F; | |
} | |
} | |
@Handler(value="I2B", parent = BasicPattern.class) | |
static class I2B extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.I2B; | |
} | |
} | |
@Handler(value="I2C", parent = BasicPattern.class) | |
static class I2C extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.I2C; | |
} | |
} | |
@Handler(value="I2S", parent = BasicPattern.class) | |
static class I2S extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.I2S; | |
} | |
} | |
@Handler(value="LCMP", parent = BasicPattern.class) | |
static class LCMP extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LCMP; | |
} | |
} | |
@Handler(value="FCMPL", parent = BasicPattern.class) | |
static class FCMPL extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FCMPL; | |
} | |
} | |
@Handler(value="FCMPG", parent = BasicPattern.class) | |
static class FCMPG extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FCMPG; | |
} | |
} | |
@Handler(value="DCMPL", parent = BasicPattern.class) | |
static class DCMPL extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DCMPL; | |
} | |
} | |
@Handler(value="DCMPG", parent = BasicPattern.class) | |
static class DCMPG extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DCMPG; | |
} | |
} | |
@Handler(value="IFEQ", parent = BasicPattern.class) | |
static class IFEQ extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IFEQ; | |
} | |
} | |
@Handler(value="IFNE", parent = BasicPattern.class) | |
static class IFNE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IFNE; | |
} | |
} | |
@Handler(value="IFLT", parent = BasicPattern.class) | |
static class IFLT extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IFLT; | |
} | |
} | |
@Handler(value="IFGE", parent = BasicPattern.class) | |
static class IFGE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IFGE; | |
} | |
} | |
@Handler(value="IFGT", parent = BasicPattern.class) | |
static class IFGT extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IFGT; | |
} | |
} | |
@Handler(value="IFLE", parent = BasicPattern.class) | |
static class IFLE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IFLE; | |
} | |
} | |
@Handler(value="IF_ICMPEQ", parent = BasicPattern.class) | |
static class IF_ICMPEQ extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IF_ICMPEQ; | |
} | |
} | |
@Handler(value="IF_ICMPNE", parent = BasicPattern.class) | |
static class IF_ICMPNE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IF_ICMPNE; | |
} | |
} | |
@Handler(value="IF_ICMPLT", parent = BasicPattern.class) | |
static class IF_ICMPLT extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IF_ICMPLT; | |
} | |
} | |
@Handler(value="IF_ICMPGE", parent = BasicPattern.class) | |
static class IF_ICMPGE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IF_ICMPGE; | |
} | |
} | |
@Handler(value="IF_ICMPGT", parent = BasicPattern.class) | |
static class IF_ICMPGT extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IF_ICMPGT; | |
} | |
} | |
@Handler(value="IF_ICMPLE", parent = BasicPattern.class) | |
static class IF_ICMPLE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IF_ICMPLE; | |
} | |
} | |
@Handler(value="IF_ACMPEQ", parent = BasicPattern.class) | |
static class IF_ACMPEQ extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IF_ACMPEQ; | |
} | |
} | |
@Handler(value="IF_ACMPNE", parent = BasicPattern.class) | |
static class IF_ACMPNE extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IF_ACMPNE; | |
} | |
} | |
@Handler(value="GOTO", parent = BasicPattern.class) | |
static class GOTO extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.GOTO; | |
} | |
} | |
@Handler(value="JSR", parent = BasicPattern.class) | |
static class JSR extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.JSR; | |
} | |
} | |
@Handler(value="RET", parent = BasicPattern.class) | |
static class RET extends BasicPatternNode { | |
@Attribute(value="var", dflt="") Integer var; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.RET) { | |
return false; | |
} | |
VarInsnNode cast = (VarInsnNode) node; | |
if (var != null && var != cast.var) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="TABLESWITCH", parent = BasicPattern.class) | |
static class TABLESWITCH extends BasicPatternNode { | |
@Attribute(value="min", dflt="") Integer min; | |
@Attribute(value="max", dflt="") Integer max; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.TABLESWITCH) { | |
return false; | |
} | |
TableSwitchInsnNode cast = (TableSwitchInsnNode) node; | |
if (max != null && max != cast.max) { | |
return false; | |
} | |
if (min != null && min != cast.min) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="LOOKUPSWITCH", parent = BasicPattern.class) | |
static class LOOKUPSWITCH extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LOOKUPSWITCH; | |
} | |
} | |
@Handler(value="IRETURN", parent = BasicPattern.class) | |
static class IRETURN extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IRETURN; | |
} | |
} | |
@Handler(value="LRETURN", parent = BasicPattern.class) | |
static class LRETURN extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.LRETURN; | |
} | |
} | |
@Handler(value="FRETURN", parent = BasicPattern.class) | |
static class FRETURN extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.FRETURN; | |
} | |
} | |
@Handler(value="DRETURN", parent = BasicPattern.class) | |
static class DRETURN extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.DRETURN; | |
} | |
} | |
@Handler(value="ARETURN", parent = BasicPattern.class) | |
static class ARETURN extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ARETURN; | |
} | |
} | |
@Handler(value="RETURN", parent = BasicPattern.class) | |
static class RETURN extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.RETURN; | |
} | |
} | |
@Handler(value="GETSTATIC", parent = BasicPattern.class) | |
static class GETSTATIC extends BasicPatternNode { | |
@Attribute(value="owner", dflt="") String owner; | |
@Attribute(value="name", dflt="") String name; | |
@Attribute(value="desc", dflt="") String desc; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.GETSTATIC) { | |
return false; | |
} | |
FieldInsnNode cast = (FieldInsnNode) node; | |
/* Replace variables */ | |
String owner = TypeUtils.computeText(context, this.owner); | |
if (!owner.isEmpty() && !owner.equals(cast.owner)) { | |
return false; | |
} | |
/* Replace variables */ | |
String name = TypeUtils.computeText(context, this.name); | |
if (!name.isEmpty() && !name.equals(cast.name)) { | |
return false; | |
} | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="PUTSTATIC", parent = BasicPattern.class) | |
static class PUTSTATIC extends BasicPatternNode { | |
@Attribute(value="owner", dflt="") String owner; | |
@Attribute(value="name", dflt="") String name; | |
@Attribute(value="desc", dflt="") String desc; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.PUTSTATIC) { | |
return false; | |
} | |
FieldInsnNode cast = (FieldInsnNode) node; | |
/* Replace variables */ | |
String owner = TypeUtils.computeText(context, this.owner); | |
if (!owner.isEmpty() && !owner.equals(cast.owner)) { | |
return false; | |
} | |
/* Replace variables */ | |
String name = TypeUtils.computeText(context, this.name); | |
if (!name.isEmpty() && !name.equals(cast.name)) { | |
return false; | |
} | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="GETFIELD", parent = BasicPattern.class) | |
static class GETFIELD extends BasicPatternNode { | |
@Attribute(value="owner", dflt="") String owner; | |
@Attribute(value="name", dflt="") String name; | |
@Attribute(value="desc", dflt="") String desc; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.GETFIELD) { | |
return false; | |
} | |
FieldInsnNode cast = (FieldInsnNode) node; | |
/* Replace variables */ | |
String owner = TypeUtils.computeText(context, this.owner); | |
if (!owner.isEmpty() && !owner.equals(cast.owner)) { | |
return false; | |
} | |
/* Replace variables */ | |
String name = TypeUtils.computeText(context, this.name); | |
if (!name.isEmpty() && !name.equals(cast.name)) { | |
return false; | |
} | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="PUTFIELD", parent = BasicPattern.class) | |
static class PUTFIELD extends BasicPatternNode { | |
@Attribute(value="owner", dflt="") String owner; | |
@Attribute(value="name", dflt="") String name; | |
@Attribute(value="desc", dflt="") String desc; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.PUTFIELD) { | |
return false; | |
} | |
FieldInsnNode cast = (FieldInsnNode) node; | |
/* Replace variables */ | |
String owner = TypeUtils.computeText(context, this.owner); | |
if (!owner.isEmpty() && !owner.equals(cast.owner)) { | |
return false; | |
} | |
/* Replace variables */ | |
String name = TypeUtils.computeText(context, this.name); | |
if (!name.isEmpty() && !name.equals(cast.name)) { | |
return false; | |
} | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="INVOKEVIRTUAL", parent = BasicPattern.class) | |
static class INVOKEVIRTUAL extends BasicPatternNode { | |
@Attribute(value="owner", dflt="") String owner; | |
@Attribute(value="name", dflt="") String name; | |
@Attribute(value="desc", dflt="") String desc; | |
@Attribute(value="itf", dflt="") Boolean itf; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.INVOKEVIRTUAL) { | |
return false; | |
} | |
MethodInsnNode cast = (MethodInsnNode) node; | |
/* Replace variables */ | |
String owner = TypeUtils.computeText(context, this.owner); | |
if (!owner.isEmpty() && !owner.equals(cast.owner)) { | |
return false; | |
} | |
/* Replace variables */ | |
String name = TypeUtils.computeText(context, this.name); | |
if (!name.isEmpty() && !name.equals(cast.name)) { | |
return false; | |
} | |
if (itf != null && itf != cast.itf) { | |
return false; | |
} | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="INVOKESPECIAL", parent = BasicPattern.class) | |
static class INVOKESPECIAL extends BasicPatternNode { | |
@Attribute(value="owner", dflt="") String owner; | |
@Attribute(value="name", dflt="") String name; | |
@Attribute(value="desc", dflt="") String desc; | |
@Attribute(value="itf", dflt="") Boolean itf; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.INVOKESPECIAL) { | |
return false; | |
} | |
MethodInsnNode cast = (MethodInsnNode) node; | |
/* Replace variables */ | |
String owner = TypeUtils.computeText(context, this.owner); | |
if (!owner.isEmpty() && !owner.equals(cast.owner)) { | |
return false; | |
} | |
/* Replace variables */ | |
String name = TypeUtils.computeText(context, this.name); | |
if (!name.isEmpty() && !name.equals(cast.name)) { | |
return false; | |
} | |
if (itf != null && itf != cast.itf) { | |
return false; | |
} | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="INVOKESTATIC", parent = BasicPattern.class) | |
static class INVOKESTATIC extends BasicPatternNode { | |
@Attribute(value="owner", dflt="") String owner; | |
@Attribute(value="name", dflt="") String name; | |
@Attribute(value="desc", dflt="") String desc; | |
@Attribute(value="itf", dflt="") Boolean itf; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.INVOKESTATIC) { | |
return false; | |
} | |
MethodInsnNode cast = (MethodInsnNode) node; | |
/* Replace variables */ | |
String owner = TypeUtils.computeText(context, this.owner); | |
if (!owner.isEmpty() && !owner.equals(cast.owner)) { | |
return false; | |
} | |
/* Replace variables */ | |
String name = TypeUtils.computeText(context, this.name); | |
if (!name.isEmpty() && !name.equals(cast.name)) { | |
return false; | |
} | |
if (itf != null && itf != cast.itf) { | |
return false; | |
} | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="INVOKEINTERFACE", parent = BasicPattern.class) | |
static class INVOKEINTERFACE extends BasicPatternNode { | |
@Attribute(value="owner", dflt="") String owner; | |
@Attribute(value="name", dflt="") String name; | |
@Attribute(value="desc", dflt="") String desc; | |
@Attribute(value="itf", dflt="") Boolean itf; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.INVOKEINTERFACE) { | |
return false; | |
} | |
MethodInsnNode cast = (MethodInsnNode) node; | |
/* Replace variables */ | |
String owner = TypeUtils.computeText(context, this.owner); | |
if (!owner.isEmpty() && !owner.equals(cast.owner)) { | |
return false; | |
} | |
/* Replace variables */ | |
String name = TypeUtils.computeText(context, this.name); | |
if (!name.isEmpty() && !name.equals(cast.name)) { | |
return false; | |
} | |
if (itf != null && itf != cast.itf) { | |
return false; | |
} | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="INVOKEDYNAMIC", parent = BasicPattern.class) | |
static class INVOKEDYNAMIC extends BasicPatternNode { | |
@Attribute(value="name", dflt="") String name; | |
@Attribute(value="desc", dflt="") String desc; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.INVOKEDYNAMIC) { | |
return false; | |
} | |
InvokeDynamicInsnNode cast = (InvokeDynamicInsnNode) node; | |
/* Replace variables */ | |
String name = TypeUtils.computeText(context, this.name); | |
if (!name.isEmpty() && !name.equals(cast.name)) { | |
return false; | |
} | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="NEW", parent = BasicPattern.class) | |
static class NEW extends BasicPatternNode { | |
@Attribute(value="desc", dflt="") String desc; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.NEW) { | |
return false; | |
} | |
TypeInsnNode cast = (TypeInsnNode) node; | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="NEWARRAY", parent = BasicPattern.class) | |
static class NEWARRAY extends BasicPatternNode { | |
@Attribute(value="operand", dflt="") Integer operand; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.NEWARRAY) { | |
return false; | |
} | |
IntInsnNode cast = (IntInsnNode) node; | |
if (operand != null && operand != cast.operand) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="ANEWARRAY", parent = BasicPattern.class) | |
static class ANEWARRAY extends BasicPatternNode { | |
@Attribute(value="desc", dflt="") String desc; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.ANEWARRAY) { | |
return false; | |
} | |
TypeInsnNode cast = (TypeInsnNode) node; | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="ARRAYLENGTH", parent = BasicPattern.class) | |
static class ARRAYLENGTH extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ARRAYLENGTH; | |
} | |
} | |
@Handler(value="ATHROW", parent = BasicPattern.class) | |
static class ATHROW extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.ATHROW; | |
} | |
} | |
@Handler(value="CHECKCAST", parent = BasicPattern.class) | |
static class CHECKCAST extends BasicPatternNode { | |
@Attribute(value="desc", dflt="") String desc; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.CHECKCAST) { | |
return false; | |
} | |
TypeInsnNode cast = (TypeInsnNode) node; | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="INSTANCEOF", parent = BasicPattern.class) | |
static class INSTANCEOF extends BasicPatternNode { | |
@Attribute(value="desc", dflt="") String desc; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.INSTANCEOF) { | |
return false; | |
} | |
TypeInsnNode cast = (TypeInsnNode) node; | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="MONITORENTER", parent = BasicPattern.class) | |
static class MONITORENTER extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.MONITORENTER; | |
} | |
} | |
@Handler(value="MONITOREXIT", parent = BasicPattern.class) | |
static class MONITOREXIT extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.MONITOREXIT; | |
} | |
} | |
@Handler(value="MULTIANEWARRAY", parent = BasicPattern.class) | |
static class MULTIANEWARRAY extends BasicPatternNode { | |
@Attribute(value="desc", dflt="") String desc; | |
@Attribute(value="dims", dflt="") Integer dims; | |
public boolean test(AbstractInsnNode node) { | |
if (node.getOpcode() != Opcodes.MULTIANEWARRAY) { | |
return false; | |
} | |
MultiANewArrayInsnNode cast = (MultiANewArrayInsnNode) node; | |
if (dims != null && dims != cast.dims) { | |
return false; | |
} | |
/* Replace variables */ | |
String desc = TypeUtils.computeText(context, this.desc); | |
if (!desc.isEmpty() && !desc.equals(cast.desc)) { | |
return false; | |
} | |
return true; | |
} | |
} | |
@Handler(value="IFNULL", parent = BasicPattern.class) | |
static class IFNULL extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IFNULL; | |
} | |
} | |
@Handler(value="IFNONNULL", parent = BasicPattern.class) | |
static class IFNONNULL extends BasicPatternNode { | |
public boolean test(AbstractInsnNode node) { | |
return node.getOpcode() == Opcodes.IFNONNULL; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment