Class DefaultReduceOperator<ContentT extends AbstractState<ContentT>>
- java.lang.Object
-
- proguard.analysis.cpa.jvm.operators.DefaultReduceOperator<ContentT>
-
- Type Parameters:
ContentT
- The content of the jvm states. For example, this can be aSetAbstractState
of taints for taint analysis or aValueAbstractState
for value analysis.
- All Implemented Interfaces:
ReduceOperator<ContentT>
- Direct Known Subclasses:
TaintReduceOperator
,ValueReduceOperator
public class DefaultReduceOperator<ContentT extends AbstractState<ContentT>> extends java.lang.Object implements ReduceOperator<ContentT>
ThisReduceOperator
simulates the JVM behavior on a method call. It takes a clone of the callerJvmAbstractState
, creates an empty stack and a local variables array with the callee arguments.
-
-
Constructor Summary
Constructors Constructor Description DefaultReduceOperator()
Create the default reduce operator for the JVM.DefaultReduceOperator(boolean reduceHeap)
Create the default reduce operator for the JVM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JvmAbstractState<ContentT>
createJvmAbstractState(JvmCfaNode programLocation, JvmFrameAbstractState<ContentT> frame, JvmHeapAbstractState<ContentT> heap, MapAbstractState<java.lang.String,ContentT> staticFields)
protected void
reduceHeap(JvmHeapAbstractState<ContentT> heap, JvmFrameAbstractState<ContentT> reducedFrame, MapAbstractState<java.lang.String,ContentT> reducedStaticFields)
Reduces the heap state.JvmAbstractState<ContentT>
reduceImpl(JvmAbstractState<ContentT> expandedInitialState, JvmCfaNode blockEntryNode, Call call)
Creates the initial state of the called procedure discarding the useless information from the state of the caller.protected void
reduceStaticFields(MapAbstractState<java.lang.String,ContentT> staticFields)
Reduces the static fields.-
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.bam.ReduceOperator
onMethodEntry, reduce
-
-
-
-
Constructor Detail
-
DefaultReduceOperator
public DefaultReduceOperator()
Create the default reduce operator for the JVM.
-
DefaultReduceOperator
public DefaultReduceOperator(boolean reduceHeap)
Create the default reduce operator for the JVM.- Parameters:
reduceHeap
- whether reduction of the heap is performed
-
-
Method Detail
-
reduceImpl
public JvmAbstractState<ContentT> reduceImpl(JvmAbstractState<ContentT> expandedInitialState, JvmCfaNode blockEntryNode, Call call)
Description copied from interface:ReduceOperator
Creates the initial state of the called procedure discarding the useless information from the state of the caller.- Specified by:
reduceImpl
in interfaceReduceOperator<ContentT extends AbstractState<ContentT>>
- Parameters:
expandedInitialState
- the entry state of the called procedure before any reductionblockEntryNode
- the entry node of the called procedurecall
- the information of the call to the procedure- Returns:
- The entry state of the called procedure
-
reduceStaticFields
protected void reduceStaticFields(MapAbstractState<java.lang.String,ContentT> staticFields)
Reduces the static fields. The default implementation doesn't perform any reduction.- Parameters:
staticFields
- the static fields map that is modified by this method by performing reduction
-
reduceHeap
protected void reduceHeap(JvmHeapAbstractState<ContentT> heap, JvmFrameAbstractState<ContentT> reducedFrame, MapAbstractState<java.lang.String,ContentT> reducedStaticFields)
Reduces the heap state. The default implementation doesn't perform any reduction.- Parameters:
heap
- the heap that is modified by this method by performing reductionreducedFrame
- the frame after reduction has been performed on itreducedStaticFields
- the static fields after reduction has been performed on them
-
createJvmAbstractState
protected JvmAbstractState<ContentT> createJvmAbstractState(JvmCfaNode programLocation, JvmFrameAbstractState<ContentT> frame, JvmHeapAbstractState<ContentT> heap, MapAbstractState<java.lang.String,ContentT> staticFields)
-
-