Class JvmTransferRelation<StateT extends LatticeAbstractState<StateT>>
- java.lang.Object
-
- proguard.analysis.cpa.jvm.transfer.JvmTransferRelation<StateT>
-
- All Implemented Interfaces:
ProgramLocationDependentForwardTransferRelation<JvmCfaNode,JvmCfaEdge,MethodSignature>
,ProgramLocationDependentTransferRelation<JvmCfaNode,JvmCfaEdge,MethodSignature>
,TransferRelation
- Direct Known Subclasses:
JvmReferenceTransferRelation
,JvmTaintTransferRelation
,JvmValueTransferRelation
public abstract class JvmTransferRelation<StateT extends LatticeAbstractState<StateT>> extends java.lang.Object implements ProgramLocationDependentForwardTransferRelation<JvmCfaNode,JvmCfaEdge,MethodSignature>
TheJvmTransferRelation
computes the successors of anJvmAbstractState
for a given instruction. It stores category 2 computational types as tuples of the abstract state containing the information about the value in the most significant bits and a default abstract state in the least significant bits of the big-endian notation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
JvmTransferRelation.InstructionAbstractInterpreter
ThisInstructionVisitor
performs generic operations (e.g., loads, stores) parametrized by the specific behavior ofJvmTransferRelation
for instruction applications, method invocations, and constructing literals.
-
Constructor Summary
Constructors Constructor Description JvmTransferRelation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StateT
calculateArithmeticInstruction(Instruction instruction, java.util.List<StateT> operands)
Calculates the result of the instruction application.protected StateT
computeIncrement(StateT state, int value)
Returns the abstract state of the incremented inputstate
byvalue
.AbstractState
generateEdgeAbstractSuccessor(AbstractState abstractState, JvmCfaEdge edge, Precision precision)
StateT
getAbstractByteConstant(byte b)
Returns an abstract representation of a byte constantb
.abstract StateT
getAbstractDefault()
Returns a default abstract state.java.util.List<StateT>
getAbstractDoubleConstant(double d)
Returns an abstract representation of a double constantd
.StateT
getAbstractFloatConstant(float f)
Returns an abstract representation of a float constantf
.StateT
getAbstractIntegerConstant(int i)
Returns an abstract representation of an integer constanti
.java.util.List<StateT>
getAbstractLongConstant(long l)
Returns an abstract representation of a long constantl
.StateT
getAbstractNull()
Returns an abstract representation of a null reference.StateT
getAbstractReferenceValue(java.lang.String className)
Returns an abstract representation of a reference valueobject
.StateT
getAbstractReferenceValue(java.lang.String className, Clazz referencedClazz, boolean mayBeExtension, boolean mayBeNull)
Returns an abstract representation of a reference valueobject
.StateT
getAbstractReferenceValue(java.lang.String className, Clazz referencedClazz, boolean mayBeExtension, boolean mayBeNull, Clazz creationClass, Method creationMethod, int creationOffset, java.lang.Object value)
Returns an abstract representation of a reference valueobject
.StateT
getAbstractShortConstant(short s)
Returns an abstract representation of a short constants
.protected JvmAbstractState<StateT>
getAbstractSuccessorForInstruction(JvmAbstractState<StateT> abstractState, Instruction instruction, Clazz clazz, Precision precision)
Returns the result of applyinginstruction
to theabstractState
.protected StateT
handleCheckCast(StateT state, java.lang.String typeName)
Returns an abstract state representing the result of thecheckcast
operation.void
invokeMethod(JvmAbstractState<StateT> state, Call call, java.util.List<StateT> operands)
The default implementation computes join over its arguments.protected StateT
isInstanceOf(StateT state, java.lang.String type)
Returns an abstract state representing the result of theinstanceof
operation.protected void
processCall(JvmAbstractState<StateT> state, Call call)
Pops the arguments from the operand stack and passes them toinvokeMethod
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface proguard.analysis.cpa.interfaces.ProgramLocationDependentForwardTransferRelation
getEdges
-
Methods inherited from interface proguard.analysis.cpa.interfaces.ProgramLocationDependentTransferRelation
generateAbstractSuccessors, generateEdgeAbstractSuccessors, wrapAbstractSuccessorInCollection
-
-
-
-
Method Detail
-
generateEdgeAbstractSuccessor
public AbstractState generateEdgeAbstractSuccessor(AbstractState abstractState, JvmCfaEdge edge, Precision precision)
-
getAbstractSuccessorForInstruction
protected JvmAbstractState<StateT> getAbstractSuccessorForInstruction(JvmAbstractState<StateT> abstractState, Instruction instruction, Clazz clazz, Precision precision)
Returns the result of applyinginstruction
to theabstractState
.
-
calculateArithmeticInstruction
protected StateT calculateArithmeticInstruction(Instruction instruction, java.util.List<StateT> operands)
Calculates the result of the instruction application. The default implementation computes join over its arguments.
-
computeIncrement
protected StateT computeIncrement(StateT state, int value)
Returns the abstract state of the incremented inputstate
byvalue
. The default implementation computes the join.
-
getAbstractByteConstant
public StateT getAbstractByteConstant(byte b)
Returns an abstract representation of a byte constantb
.
-
getAbstractDefault
public abstract StateT getAbstractDefault()
Returns a default abstract state. In case of lattice abstract domains, it should be the bottom element.
-
getAbstractDoubleConstant
public java.util.List<StateT> getAbstractDoubleConstant(double d)
Returns an abstract representation of a double constantd
.
-
getAbstractFloatConstant
public StateT getAbstractFloatConstant(float f)
Returns an abstract representation of a float constantf
.
-
getAbstractIntegerConstant
public StateT getAbstractIntegerConstant(int i)
Returns an abstract representation of an integer constanti
.
-
getAbstractLongConstant
public java.util.List<StateT> getAbstractLongConstant(long l)
Returns an abstract representation of a long constantl
.
-
getAbstractNull
public StateT getAbstractNull()
Returns an abstract representation of a null reference.
-
getAbstractShortConstant
public StateT getAbstractShortConstant(short s)
Returns an abstract representation of a short constants
.
-
getAbstractReferenceValue
public StateT getAbstractReferenceValue(java.lang.String className)
Returns an abstract representation of a reference valueobject
.
-
getAbstractReferenceValue
public StateT getAbstractReferenceValue(java.lang.String className, Clazz referencedClazz, boolean mayBeExtension, boolean mayBeNull)
Returns an abstract representation of a reference valueobject
.
-
getAbstractReferenceValue
public StateT getAbstractReferenceValue(java.lang.String className, Clazz referencedClazz, boolean mayBeExtension, boolean mayBeNull, Clazz creationClass, Method creationMethod, int creationOffset, java.lang.Object value)
Returns an abstract representation of a reference valueobject
.
-
processCall
protected void processCall(JvmAbstractState<StateT> state, Call call)
Pops the arguments from the operand stack and passes them toinvokeMethod
.
-
invokeMethod
public void invokeMethod(JvmAbstractState<StateT> state, Call call, java.util.List<StateT> operands)
The default implementation computes join over its arguments.
-
isInstanceOf
protected StateT isInstanceOf(StateT state, java.lang.String type)
Returns an abstract state representing the result of theinstanceof
operation.
-
-