Package proguard.evaluation
Class BasicInvocationUnit
- java.lang.Object
-
- proguard.evaluation.SimplifiedInvocationUnit
-
- proguard.evaluation.BasicInvocationUnit
-
- All Implemented Interfaces:
ConstantVisitor
,MemberVisitor
,ParameterVisitor
,InvocationUnit
- Direct Known Subclasses:
ExecutingInvocationUnit
public class BasicInvocationUnit extends SimplifiedInvocationUnit implements InvocationUnit, MemberVisitor
ThisInvocationUnit
sets up the variables for entering a method, and it updates the stack for the invocation of a class member, using simple values.
-
-
Field Summary
Fields Modifier and Type Field Description protected ValueFactory
valueFactory
-
Constructor Summary
Constructors Constructor Description BasicInvocationUnit(ValueFactory valueFactory)
Creates a new BasicInvocationUnit with the given value factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
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.void
visitLibraryField(LibraryClass programClass, LibraryField libraryField)
void
visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod)
void
visitProgramField(ProgramClass programClass, ProgramField programField)
void
visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
-
Methods inherited from class proguard.evaluation.SimplifiedInvocationUnit
enterExceptionHandler, enterMethod, exitMethod, invokeMember, methodMayHaveSideEffects, visitAnyMethodrefConstant, visitFieldrefConstant, visitInvokeDynamicConstant, visitParameter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods 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
-
Methods inherited from interface proguard.evaluation.InvocationUnit
enterExceptionHandler, enterMethod, exitMethod, invokeMember
-
Methods inherited from interface proguard.classfile.visitor.MemberVisitor
visitAnyMember, visitLibraryMember, visitProgramMember
-
-
-
-
Field Detail
-
valueFactory
protected final ValueFactory valueFactory
-
-
Constructor Detail
-
BasicInvocationUnit
public BasicInvocationUnit(ValueFactory valueFactory)
Creates a new BasicInvocationUnit with the given value factory.
-
-
Method Detail
-
getExceptionValue
public Value getExceptionValue(Clazz clazz, ClassConstant catchClassConstant)
Description copied from class:SimplifiedInvocationUnit
Returns the value of the specified exception.- Specified by:
getExceptionValue
in classSimplifiedInvocationUnit
-
setFieldClassValue
public void setFieldClassValue(Clazz clazz, FieldrefConstant fieldrefConstant, ReferenceValue value)
Description copied from class:SimplifiedInvocationUnit
Sets the class through which the specified field is accessed.- Specified by:
setFieldClassValue
in classSimplifiedInvocationUnit
-
getFieldClassValue
public Value getFieldClassValue(Clazz clazz, FieldrefConstant fieldrefConstant, java.lang.String type)
Description copied from class:SimplifiedInvocationUnit
Returns the class though which the specified field is accessed.- Specified by:
getFieldClassValue
in classSimplifiedInvocationUnit
-
setFieldValue
public void setFieldValue(Clazz clazz, FieldrefConstant fieldrefConstant, Value value)
Description copied from class:SimplifiedInvocationUnit
Sets the value of the specified field.- Specified by:
setFieldValue
in classSimplifiedInvocationUnit
-
getFieldValue
public Value getFieldValue(Clazz clazz, FieldrefConstant fieldrefConstant, java.lang.String type)
Description copied from class:SimplifiedInvocationUnit
Returns the value of the specified field.- Specified by:
getFieldValue
in classSimplifiedInvocationUnit
-
setMethodParameterValue
public void setMethodParameterValue(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, int parameterIndex, Value value)
Description copied from class:SimplifiedInvocationUnit
Sets the value of the specified method parameter.- Specified by:
setMethodParameterValue
in classSimplifiedInvocationUnit
-
getMethodParameterValue
public Value getMethodParameterValue(Clazz clazz, Method method, int parameterIndex, java.lang.String type, Clazz referencedClass)
Description copied from class:SimplifiedInvocationUnit
Returns the value of the specified method parameter.- Specified by:
getMethodParameterValue
in classSimplifiedInvocationUnit
-
setMethodReturnValue
public void setMethodReturnValue(Clazz clazz, Method method, Value value)
Description copied from class:SimplifiedInvocationUnit
Sets the return value of the specified method.- Specified by:
setMethodReturnValue
in classSimplifiedInvocationUnit
-
getMethodReturnValue
public Value getMethodReturnValue(Clazz clazz, AnyMethodrefConstant anyMethodrefConstant, java.lang.String type)
Description copied from class:SimplifiedInvocationUnit
Returns the return value of the specified method.- Specified by:
getMethodReturnValue
in classSimplifiedInvocationUnit
-
getMethodReturnValue
public Value getMethodReturnValue(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant, java.lang.String type)
Returns the return value of the specified method.- Specified by:
getMethodReturnValue
in classSimplifiedInvocationUnit
-
visitProgramField
public void visitProgramField(ProgramClass programClass, ProgramField programField)
- Specified by:
visitProgramField
in interfaceMemberVisitor
-
visitProgramMethod
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
- Specified by:
visitProgramMethod
in interfaceMemberVisitor
-
visitLibraryField
public void visitLibraryField(LibraryClass programClass, LibraryField libraryField)
- Specified by:
visitLibraryField
in interfaceMemberVisitor
-
visitLibraryMethod
public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod)
- Specified by:
visitLibraryMethod
in interfaceMemberVisitor
-
-