类 ReferenceTracingInvocationUnit
- java.lang.Object
-
- proguard.evaluation.SimplifiedInvocationUnit
-
- proguard.evaluation.ReferenceTracingInvocationUnit
-
- 所有已实现的接口:
ConstantVisitor,ParameterVisitor,InvocationUnit
public class ReferenceTracingInvocationUnit extends SimplifiedInvocationUnit
ThisInvocationUnittags 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).
-
-
构造器概要
构造器 构造器 说明 ReferenceTracingInvocationUnit(SimplifiedInvocationUnit invocationUnit)Creates a new ReferenceTracingInvocationUnit.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected voidapplySideEffects(Clazz clazz, AnyMethodrefConstant methodrefConstant, java.lang.String type)voidenterExceptionHandler(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int catchType, Stack stack)Sets up the given stack for entering the given exception handler.ValuegetExceptionValue(Clazz clazz, ClassConstant catchClassConstant)Returns the value of the specified exception.ValuegetFieldClassValue(Clazz clazz, FieldrefConstant fieldrefConstant, java.lang.String type)Returns the class though which the specified field is accessed.ValuegetFieldValue(Clazz clazz, FieldrefConstant fieldrefConstant, java.lang.String type)Returns the value of the specified field.ValuegetMethodParameterValue(Clazz clazz, Method method, int parameterIndex, java.lang.String type, Clazz referencedClass)Returns the value of the specified method parameter.ValuegetMethodReturnValue(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, java.lang.String type)Returns the return value of the specified method.ValuegetMethodReturnValue(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant, java.lang.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.protected booleanmethodMayHaveSideEffects(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, java.lang.String returnType)Returns true if the method itself can modify the stack/variables and therefore needs to be executed even if it returns void.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 Valuetrace(Value value, int trace)Sets 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.voidvisitAnyMethodrefConstant(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant)Visits any RefConstant instance.-
从类继承的方法 proguard.evaluation.SimplifiedInvocationUnit
enterMethod, exitMethod, visitFieldrefConstant, visitInvokeDynamicConstant, visitParameter
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 proguard.classfile.constant.visitor.ConstantVisitor
visitAnyConstant, visitAnyRefConstant, visitClassConstant, visitDoubleConstant, visitDynamicConstant, visitFloatConstant, visitIntegerConstant, visitInterfaceMethodrefConstant, visitLongConstant, visitMethodHandleConstant, visitMethodrefConstant, visitMethodTypeConstant, visitModuleConstant, visitNameAndTypeConstant, visitPackageConstant, visitPrimitiveArrayConstant, visitStringConstant, visitUtf8Constant
-
-
-
-
构造器详细资料
-
ReferenceTracingInvocationUnit
public ReferenceTracingInvocationUnit(SimplifiedInvocationUnit invocationUnit)
Creates a new ReferenceTracingInvocationUnit.- 参数:
invocationUnit- the invocation unit to which invocations will be delegated.
-
-
方法详细资料
-
enterExceptionHandler
public void enterExceptionHandler(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int catchType, Stack stack)
从接口复制的说明:InvocationUnitSets up the given stack for entering the given exception handler.- 指定者:
enterExceptionHandler在接口中InvocationUnit- 覆盖:
enterExceptionHandler在类中SimplifiedInvocationUnit
-
invokeMember
public void invokeMember(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction, Stack stack, Variables variables)
从接口复制的说明:InvocationUnitUpdates the given stack corresponding to the execution of the given field or method reference instruction.- 指定者:
invokeMember在接口中InvocationUnit- 覆盖:
invokeMember在类中SimplifiedInvocationUnit
-
visitAnyMethodrefConstant
public void visitAnyMethodrefConstant(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant)
从接口复制的说明:ConstantVisitorVisits any RefConstant instance. The more specific default implementations of this interface delegate to this method.
-
getExceptionValue
public Value getExceptionValue(Clazz clazz, ClassConstant catchClassConstant)
从类复制的说明:SimplifiedInvocationUnitReturns the value of the specified exception.
-
setFieldClassValue
public void setFieldClassValue(Clazz clazz, FieldrefConstant fieldrefConstant, ReferenceValue value)
从类复制的说明:SimplifiedInvocationUnitSets the class through which the specified field is accessed.
-
getFieldClassValue
public Value getFieldClassValue(Clazz clazz, FieldrefConstant fieldrefConstant, java.lang.String type)
从类复制的说明:SimplifiedInvocationUnitReturns the class though which the specified field is accessed.
-
setFieldValue
public void setFieldValue(Clazz clazz, FieldrefConstant fieldrefConstant, Value value)
从类复制的说明:SimplifiedInvocationUnitSets the value of the specified field.- 指定者:
setFieldValue在类中SimplifiedInvocationUnit
-
getFieldValue
public Value getFieldValue(Clazz clazz, FieldrefConstant fieldrefConstant, java.lang.String type)
从类复制的说明:SimplifiedInvocationUnitReturns the value of the specified field.- 指定者:
getFieldValue在类中SimplifiedInvocationUnit
-
setMethodParameterValue
public void setMethodParameterValue(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, int parameterIndex, Value value)
从类复制的说明:SimplifiedInvocationUnitSets the value of the specified method parameter.
-
getMethodParameterValue
public Value getMethodParameterValue(Clazz clazz, Method method, int parameterIndex, java.lang.String type, Clazz referencedClass)
从类复制的说明:SimplifiedInvocationUnitReturns the value of the specified method parameter.
-
setMethodReturnValue
public void setMethodReturnValue(Clazz clazz, Method method, Value value)
从类复制的说明:SimplifiedInvocationUnitSets the return value of the specified method.
-
getMethodReturnValue
public Value getMethodReturnValue(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, java.lang.String type)
从类复制的说明:SimplifiedInvocationUnitReturns the return value of the specified method.
-
getMethodReturnValue
public Value getMethodReturnValue(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant, java.lang.String type)
从类复制的说明:SimplifiedInvocationUnitReturns the return value of the specified method.
-
methodMayHaveSideEffects
protected boolean methodMayHaveSideEffects(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, java.lang.String returnType)
从类复制的说明:SimplifiedInvocationUnitReturns true if the method itself can modify the stack/variables and therefore needs to be executed even if it returns void.
-
applySideEffects
protected void applySideEffects(Clazz clazz, AnyMethodrefConstant methodrefConstant, java.lang.String type)
-
trace
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.
-
trace
protected Value trace(Value value, InstructionOffsetValue traceValue)
Sets or replaces the trace value on a given value, returning the result.
-
-