public class ReferenceTracingInvocationUnit extends SimplifiedInvocationUnit
InvocationUnit tags reference values of retrieved fields, passed method
parameters, method return values, and caught exceptions, so they can be
traced throughout the execution of a method. The tags are instruction offsets
or parameter indices (not parameter offsets).TracedReferenceValue,
InstructionOffsetValue| Constructor and Description |
|---|
ReferenceTracingInvocationUnit(SimplifiedInvocationUnit invocationUnit)
Creates a new ReferenceTracingInvocationUnit.
|
| Modifier and Type | Method and Description |
|---|---|
void |
enterExceptionHandler(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
int catchType,
Stack stack)
Sets up the given stack for entering the given exception handler.
|
Value |
getExceptionValue(Clazz clazz,
ClassConstant catchClassConstant)
Returns the value of the specified exception.
|
Value |
getFieldClassValue(Clazz clazz,
FieldrefConstant fieldrefConstant,
java.lang.String type)
Returns the class though which the specified field is accessed.
|
Value |
getFieldValue(Clazz clazz,
FieldrefConstant fieldrefConstant,
java.lang.String type)
Returns the value of the specified field.
|
Value |
getMethodParameterValue(Clazz clazz,
Method method,
int parameterIndex,
java.lang.String type,
Clazz referencedClass)
Returns the value of the specified method parameter.
|
Value |
getMethodReturnValue(Clazz clazz,
AnyMethodrefConstant anyMethodrefConstant,
java.lang.String type)
Returns the return value of the specified method.
|
Value |
getMethodReturnValue(Clazz clazz,
InvokeDynamicConstant invokeDynamicConstant,
java.lang.String type)
Returns the return value of the specified method.
|
void |
invokeMember(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
ConstantInstruction constantInstruction,
Stack stack,
Variables variables)
Updates the given stack corresponding to the execution of the given
field or method reference instruction.
|
void |
setFieldClassValue(Clazz clazz,
FieldrefConstant fieldrefConstant,
ReferenceValue value)
Sets the class through which the specified field is accessed.
|
void |
setFieldValue(Clazz clazz,
FieldrefConstant fieldrefConstant,
Value value)
Sets the value of the specified field.
|
void |
setMethodParameterValue(Clazz clazz,
AnyMethodrefConstant anyMethodrefConstant,
int parameterIndex,
Value value)
Sets the value of the specified method parameter.
|
void |
setMethodReturnValue(Clazz clazz,
Method method,
Value value)
Sets the return value of the specified method.
|
protected Value |
trace(Value value,
InstructionOffsetValue traceValue)
Sets or replaces the trace value on a given value, returning the result.
|
protected Value |
trace(Value value,
int trace)
Sets or replaces the trace value on a given value, if it's a
reference value, returning the result.
|
enterMethod, exitMethod, methodMayHaveSideEffects, visitAnyMethodrefConstant, visitFieldrefConstant, visitInvokeDynamicConstant, visitParameterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvisitAnyConstant, visitAnyRefConstant, visitClassConstant, visitDoubleConstant, visitDynamicConstant, visitFloatConstant, visitIntegerConstant, visitInterfaceMethodrefConstant, visitLongConstant, visitMethodHandleConstant, visitMethodrefConstant, visitMethodTypeConstant, visitModuleConstant, visitNameAndTypeConstant, visitPackageConstant, visitPrimitiveArrayConstant, visitStringConstant, visitUtf8Constantpublic ReferenceTracingInvocationUnit(SimplifiedInvocationUnit invocationUnit)
invocationUnit - the invocation unit to which invocations will
be delegated.public void enterExceptionHandler(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int catchType, Stack stack)
InvocationUnitenterExceptionHandler in interface InvocationUnitenterExceptionHandler in class SimplifiedInvocationUnitpublic void invokeMember(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction, Stack stack, Variables variables)
InvocationUnitinvokeMember in interface InvocationUnitinvokeMember in class SimplifiedInvocationUnitpublic Value getExceptionValue(Clazz clazz, ClassConstant catchClassConstant)
SimplifiedInvocationUnitgetExceptionValue in class SimplifiedInvocationUnitpublic void setFieldClassValue(Clazz clazz, FieldrefConstant fieldrefConstant, ReferenceValue value)
SimplifiedInvocationUnitsetFieldClassValue in class SimplifiedInvocationUnitpublic Value getFieldClassValue(Clazz clazz, FieldrefConstant fieldrefConstant, java.lang.String type)
SimplifiedInvocationUnitgetFieldClassValue in class SimplifiedInvocationUnitpublic void setFieldValue(Clazz clazz, FieldrefConstant fieldrefConstant, Value value)
SimplifiedInvocationUnitsetFieldValue in class SimplifiedInvocationUnitpublic Value getFieldValue(Clazz clazz, FieldrefConstant fieldrefConstant, java.lang.String type)
SimplifiedInvocationUnitgetFieldValue in class SimplifiedInvocationUnitpublic void setMethodParameterValue(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, int parameterIndex, Value value)
SimplifiedInvocationUnitsetMethodParameterValue in class SimplifiedInvocationUnitpublic Value getMethodParameterValue(Clazz clazz, Method method, int parameterIndex, java.lang.String type, Clazz referencedClass)
SimplifiedInvocationUnitgetMethodParameterValue in class SimplifiedInvocationUnitpublic void setMethodReturnValue(Clazz clazz, Method method, Value value)
SimplifiedInvocationUnitsetMethodReturnValue in class SimplifiedInvocationUnitpublic Value getMethodReturnValue(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, java.lang.String type)
SimplifiedInvocationUnitgetMethodReturnValue in class SimplifiedInvocationUnitpublic Value getMethodReturnValue(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant, java.lang.String type)
SimplifiedInvocationUnitgetMethodReturnValue in class SimplifiedInvocationUnitprotected Value trace(Value value, int trace)
protected Value trace(Value value, InstructionOffsetValue traceValue)