protected static class ArgumentMatcherPositionFinder.MethodInterpreter
extends org.objectweb.asm.tree.analysis.BasicInterpreter
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentIndex |
protected int |
currentLineNr |
protected Method |
currentMatcherMethod |
protected int |
fromLineNr |
protected Set<org.objectweb.asm.tree.MethodInsnNode> |
handledMethodInsnNodes |
protected int |
index |
protected Class<?> |
interpretedClass |
protected String |
interpretedMethodName |
protected String |
invokedMethodDescriptor |
protected String |
invokedMethodName |
protected List<Integer> |
resultArgumentMatcherIndexes |
protected int |
toLineNr |
AALOAD, AASTORE, ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_DEPRECATED, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VARARGS, ACC_VOLATILE, ACONST_NULL, ALOAD, ANEWARRAY, ARETURN, ARRAYLENGTH, ASTORE, ATHROW, BALOAD, BASTORE, BIPUSH, CALOAD, CASTORE, CHECKCAST, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DMUL, DNEG, DOUBLE, DREM, DRETURN, DSTORE, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F_APPEND, F_CHOP, F_FULL, F_NEW, F_SAME, F_SAME1, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FLOAT, FMUL, FNEG, FREM, FRETURN, FSTORE, FSUB, GETFIELD, GETSTATIC, GOTO, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IINC, ILOAD, IMUL, INEG, INSTANCEOF, INTEGER, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISUB, IUSHR, IXOR, JSR, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDIV, LLOAD, LMUL, LNEG, LONG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, NEW, NEWARRAY, NOP, NULL, POP, POP2, PUTFIELD, PUTSTATIC, RET, RETURN, SALOAD, SASTORE, SIPUSH, SWAP, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TABLESWITCH, TOP, UNINITIALIZED_THIS, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6| Constructor and Description |
|---|
ArgumentMatcherPositionFinder.MethodInterpreter(Class<?> interpretedClass,
String interpretedMethodName,
String invokedMethodName,
String invokedMethodDescriptor,
int fromLineNr,
int toLineNr,
int index)
Creates an interpreter.
|
| Modifier and Type | Method and Description |
|---|---|
org.objectweb.asm.tree.analysis.Value |
binaryOperation(org.objectweb.asm.tree.AbstractInsnNode insn,
org.objectweb.asm.tree.analysis.Value value1,
org.objectweb.asm.tree.analysis.Value value2) |
org.objectweb.asm.tree.analysis.Value |
copyOperation(org.objectweb.asm.tree.AbstractInsnNode insn,
org.objectweb.asm.tree.analysis.Value value) |
protected ArgumentMatcherPositionFinder.ArgumentMatcherValue |
createArgumentMatcherValue(org.objectweb.asm.tree.analysis.Value resultValue) |
protected List<Integer> |
getArgumentMatcherIndexes(org.objectweb.asm.tree.MethodInsnNode methodInsnNode,
List values) |
protected Method |
getMethod(org.objectweb.asm.tree.MethodInsnNode methodNode)
Finds a method using the ASM method node
|
protected int |
getNrOfArgumentMacherValues(List<org.objectweb.asm.tree.analysis.Value> values) |
List<Integer> |
getResultArgumentMatcherIndexes()
Gets the result after the analysis was performed.
|
protected org.objectweb.asm.tree.analysis.Value |
getValue(org.objectweb.asm.tree.analysis.Value resultValue,
List<org.objectweb.asm.tree.analysis.Value> values) |
protected org.objectweb.asm.tree.analysis.Value |
getValue(org.objectweb.asm.tree.analysis.Value resultValue,
org.objectweb.asm.tree.analysis.Value... values) |
protected boolean |
instructionAlreadyHandled(org.objectweb.asm.tree.MethodInsnNode methodInsnNode) |
protected boolean |
instructionOutOfRange() |
protected boolean |
isArgumentMatcherMethod(Method method) |
protected boolean |
isInvokedMethod(org.objectweb.asm.tree.MethodInsnNode methodInsnNode) |
protected boolean |
isMatcherMethod(Method method) |
org.objectweb.asm.tree.analysis.Value |
merge(org.objectweb.asm.tree.analysis.Value value1,
org.objectweb.asm.tree.analysis.Value value2)
Merges two values.
|
org.objectweb.asm.tree.analysis.Value |
naryOperation(org.objectweb.asm.tree.AbstractInsnNode instructionNode,
List values)
Handles an instruction of a method call.
|
void |
setCurrentLineNr(int currentLineNr)
Sets the line nr that is being analyzed.
|
org.objectweb.asm.tree.analysis.Value |
ternaryOperation(org.objectweb.asm.tree.AbstractInsnNode insn,
org.objectweb.asm.tree.analysis.Value value1,
org.objectweb.asm.tree.analysis.Value value2,
org.objectweb.asm.tree.analysis.Value value3) |
protected void |
throwUnitilsException(String errorMessage)
Throws a
UnitilsException with the given error message. |
org.objectweb.asm.tree.analysis.Value |
unaryOperation(org.objectweb.asm.tree.AbstractInsnNode insn,
org.objectweb.asm.tree.analysis.Value value) |
protected Class<?> interpretedClass
protected String interpretedMethodName
protected String invokedMethodName
protected String invokedMethodDescriptor
protected int fromLineNr
protected int toLineNr
protected int index
protected int currentLineNr
protected int currentIndex
protected Method currentMatcherMethod
protected Set<org.objectweb.asm.tree.MethodInsnNode> handledMethodInsnNodes
public ArgumentMatcherPositionFinder.MethodInterpreter(Class<?> interpretedClass, String interpretedMethodName, String invokedMethodName, String invokedMethodDescriptor, int fromLineNr, int toLineNr, int index)
interpretedClass - The current class, not nullinterpretedMethodName - The current method name, not nullinvokedMethodName - The method to look for, not nullinvokedMethodDescriptor - The signature of the method to look for, not nullfromLineNr - The begin line-nr of the invocationtoLineNr - The end line-nr of the invocation (could be different from the begin line-nr if the invocation is written on more than 1 line)index - The index of the matcher on that line, 1 for the first, 2 for the second etcpublic List<Integer> getResultArgumentMatcherIndexes()
public void setCurrentLineNr(int currentLineNr)
currentLineNr - The line nrpublic org.objectweb.asm.tree.analysis.Value copyOperation(org.objectweb.asm.tree.AbstractInsnNode insn,
org.objectweb.asm.tree.analysis.Value value)
throws org.objectweb.asm.tree.analysis.AnalyzerException
copyOperation in interface org.objectweb.asm.tree.analysis.InterpretercopyOperation in class org.objectweb.asm.tree.analysis.BasicInterpreterorg.objectweb.asm.tree.analysis.AnalyzerExceptionpublic org.objectweb.asm.tree.analysis.Value unaryOperation(org.objectweb.asm.tree.AbstractInsnNode insn,
org.objectweb.asm.tree.analysis.Value value)
throws org.objectweb.asm.tree.analysis.AnalyzerException
unaryOperation in interface org.objectweb.asm.tree.analysis.InterpreterunaryOperation in class org.objectweb.asm.tree.analysis.BasicInterpreterorg.objectweb.asm.tree.analysis.AnalyzerExceptionpublic org.objectweb.asm.tree.analysis.Value binaryOperation(org.objectweb.asm.tree.AbstractInsnNode insn,
org.objectweb.asm.tree.analysis.Value value1,
org.objectweb.asm.tree.analysis.Value value2)
throws org.objectweb.asm.tree.analysis.AnalyzerException
binaryOperation in interface org.objectweb.asm.tree.analysis.InterpreterbinaryOperation in class org.objectweb.asm.tree.analysis.BasicInterpreterorg.objectweb.asm.tree.analysis.AnalyzerExceptionpublic org.objectweb.asm.tree.analysis.Value ternaryOperation(org.objectweb.asm.tree.AbstractInsnNode insn,
org.objectweb.asm.tree.analysis.Value value1,
org.objectweb.asm.tree.analysis.Value value2,
org.objectweb.asm.tree.analysis.Value value3)
throws org.objectweb.asm.tree.analysis.AnalyzerException
ternaryOperation in interface org.objectweb.asm.tree.analysis.InterpreterternaryOperation in class org.objectweb.asm.tree.analysis.BasicInterpreterorg.objectweb.asm.tree.analysis.AnalyzerExceptionpublic org.objectweb.asm.tree.analysis.Value naryOperation(org.objectweb.asm.tree.AbstractInsnNode instructionNode,
List values)
throws org.objectweb.asm.tree.analysis.AnalyzerException
naryOperation in interface org.objectweb.asm.tree.analysis.InterpreternaryOperation in class org.objectweb.asm.tree.analysis.BasicInterpreterinstructionNode - The instructionvalues - The operandsorg.objectweb.asm.tree.analysis.AnalyzerExceptionprotected boolean instructionOutOfRange()
protected boolean instructionAlreadyHandled(org.objectweb.asm.tree.MethodInsnNode methodInsnNode)
protected boolean isInvokedMethod(org.objectweb.asm.tree.MethodInsnNode methodInsnNode)
protected List<Integer> getArgumentMatcherIndexes(org.objectweb.asm.tree.MethodInsnNode methodInsnNode, List values)
protected boolean isMatcherMethod(Method method)
protected boolean isArgumentMatcherMethod(Method method)
protected void throwUnitilsException(String errorMessage)
UnitilsException with the given error message. The stacktrace is modified, to make
it point to the line of code that was analyzed by this class.errorMessage - The error messagepublic org.objectweb.asm.tree.analysis.Value merge(org.objectweb.asm.tree.analysis.Value value1,
org.objectweb.asm.tree.analysis.Value value2)
merge in interface org.objectweb.asm.tree.analysis.Interpretermerge in class org.objectweb.asm.tree.analysis.BasicInterpretervalue1 - The first valuevalue2 - The second valueprotected Method getMethod(org.objectweb.asm.tree.MethodInsnNode methodNode)
methodNode - The ASM method node, not nullprotected org.objectweb.asm.tree.analysis.Value getValue(org.objectweb.asm.tree.analysis.Value resultValue,
org.objectweb.asm.tree.analysis.Value... values)
resultValue - The result valuevalues - The values that can be ArgumentMatcherValuesprotected org.objectweb.asm.tree.analysis.Value getValue(org.objectweb.asm.tree.analysis.Value resultValue,
List<org.objectweb.asm.tree.analysis.Value> values)
resultValue - The result valuevalues - The values that can be ArgumentMatcherValuesprotected int getNrOfArgumentMacherValues(List<org.objectweb.asm.tree.analysis.Value> values)
values - The values that can be ArgumentMatcherValuesprotected ArgumentMatcherPositionFinder.ArgumentMatcherValue createArgumentMatcherValue(org.objectweb.asm.tree.analysis.Value resultValue)
resultValue - The result valueCopyright © 2016. All Rights Reserved.