Package proguard.evaluation
Class ReferenceTracingInvocationUnit
java.lang.Object
proguard.evaluation.SimplifiedInvocationUnit
proguard.evaluation.ReferenceTracingInvocationUnit
- All Implemented Interfaces:
ConstantVisitor,ParameterVisitor,InvocationUnit
This
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).- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionReferenceTracingInvocationUnit(SimplifiedInvocationUnit invocationUnit) Creates a new ReferenceTracingInvocationUnit. -
Method Summary
Modifier and TypeMethodDescriptionvoidenterExceptionHandler(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int catchType, Stack stack) Sets up the given stack for entering the given exception handler.getExceptionValue(Clazz clazz, ClassConstant catchClassConstant) Returns the value of the specified exception.getFieldClassValue(Clazz clazz, FieldrefConstant fieldrefConstant, String type) Returns the class though which the specified field is accessed.getFieldValue(Clazz clazz, FieldrefConstant fieldrefConstant, String type) Returns the value of the specified field.getMethodParameterValue(Clazz clazz, Method method, int parameterIndex, String type, Clazz referencedClass) Returns the value of the specified method parameter.getMethodReturnValue(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, String type) Returns the return value of the specified method.getMethodReturnValue(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant, String type) Returns the return value of the specified method.voidinvokeMember(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.voidsetFieldClassValue(Clazz clazz, FieldrefConstant fieldrefConstant, ReferenceValue value) Sets the class through which the specified field is accessed.voidsetFieldValue(Clazz clazz, FieldrefConstant fieldrefConstant, Value value) Sets the value of the specified field.voidsetMethodParameterValue(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, int parameterIndex, Value value) Sets the value of the specified method parameter.voidsetMethodReturnValue(Clazz clazz, Method method, Value value) Sets the return value of the specified method.protected ValueSets or replaces the trace value on a given value, if it's a reference value, returning the result.protected Valuetrace(Value value, InstructionOffsetValue traceValue) Sets or replaces the trace value on a given value, returning the result.Methods inherited from class proguard.evaluation.SimplifiedInvocationUnit
enterMethod, exitMethod, methodMayHaveSideEffects, visitAnyMethodrefConstant, visitFieldrefConstant, visitInvokeDynamicConstant, visitParameterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface proguard.classfile.constant.visitor.ConstantVisitor
visitAnyConstant, visitAnyRefConstant, visitClassConstant, visitDoubleConstant, visitDynamicConstant, visitFloatConstant, visitIntegerConstant, visitInterfaceMethodrefConstant, visitLongConstant, visitMethodHandleConstant, visitMethodrefConstant, visitMethodTypeConstant, visitModuleConstant, visitNameAndTypeConstant, visitPackageConstant, visitPrimitiveArrayConstant, visitStringConstant, visitUtf8Constant
-
Constructor Details
-
ReferenceTracingInvocationUnit
Creates a new ReferenceTracingInvocationUnit.- Parameters:
invocationUnit- the invocation unit to which invocations will be delegated.
-
-
Method Details
-
enterExceptionHandler
public void enterExceptionHandler(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int catchType, Stack stack) Description copied from interface:InvocationUnitSets up the given stack for entering the given exception handler.- Specified by:
enterExceptionHandlerin interfaceInvocationUnit- Overrides:
enterExceptionHandlerin classSimplifiedInvocationUnit
-
invokeMember
public void invokeMember(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction, Stack stack, Variables variables) Description copied from interface:InvocationUnitUpdates the given stack corresponding to the execution of the given field or method reference instruction.- Specified by:
invokeMemberin interfaceInvocationUnit- Overrides:
invokeMemberin classSimplifiedInvocationUnit
-
getExceptionValue
Description copied from class:SimplifiedInvocationUnitReturns the value of the specified exception.- Specified by:
getExceptionValuein classSimplifiedInvocationUnit
-
setFieldClassValue
public void setFieldClassValue(Clazz clazz, FieldrefConstant fieldrefConstant, ReferenceValue value) Description copied from class:SimplifiedInvocationUnitSets the class through which the specified field is accessed.- Specified by:
setFieldClassValuein classSimplifiedInvocationUnit
-
getFieldClassValue
Description copied from class:SimplifiedInvocationUnitReturns the class though which the specified field is accessed.- Specified by:
getFieldClassValuein classSimplifiedInvocationUnit
-
setFieldValue
Description copied from class:SimplifiedInvocationUnitSets the value of the specified field.- Specified by:
setFieldValuein classSimplifiedInvocationUnit
-
getFieldValue
Description copied from class:SimplifiedInvocationUnitReturns the value of the specified field.- Specified by:
getFieldValuein classSimplifiedInvocationUnit
-
setMethodParameterValue
public void setMethodParameterValue(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, int parameterIndex, Value value) Description copied from class:SimplifiedInvocationUnitSets the value of the specified method parameter.- Specified by:
setMethodParameterValuein classSimplifiedInvocationUnit
-
getMethodParameterValue
public Value getMethodParameterValue(Clazz clazz, Method method, int parameterIndex, String type, Clazz referencedClass) Description copied from class:SimplifiedInvocationUnitReturns the value of the specified method parameter.- Specified by:
getMethodParameterValuein classSimplifiedInvocationUnit
-
setMethodReturnValue
Description copied from class:SimplifiedInvocationUnitSets the return value of the specified method.- Specified by:
setMethodReturnValuein classSimplifiedInvocationUnit
-
getMethodReturnValue
public Value getMethodReturnValue(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, String type) Description copied from class:SimplifiedInvocationUnitReturns the return value of the specified method.- Specified by:
getMethodReturnValuein classSimplifiedInvocationUnit
-
getMethodReturnValue
public Value getMethodReturnValue(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant, String type) Description copied from class:SimplifiedInvocationUnitReturns the return value of the specified method.- Specified by:
getMethodReturnValuein classSimplifiedInvocationUnit
-
trace
Sets or replaces the trace value on a given value, if it's a reference value, returning the result. -
trace
Sets or replaces the trace value on a given value, returning the result.
-