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 aSetAbstractStateof taints for taint analysis or aValueAbstractStatefor value analysis.
- All Implemented Interfaces:
ReduceOperator<ContentT>
- Direct Known Subclasses:
TaintReduceOperator,ValueReduceOperator
public class DefaultReduceOperator<ContentT extends AbstractState<ContentT>>
extends Object
implements ReduceOperator<ContentT>
This
ReduceOperator simulates the JVM behavior on a method call. It takes a clone of the
caller JvmAbstractState, creates an empty stack and a local variables array with the
callee arguments.-
Constructor Summary
ConstructorsConstructorDescriptionCreate the default reduce operator for the JVM.DefaultReduceOperator(boolean reduceHeap) Create the default reduce operator for the JVM. -
Method Summary
Modifier and TypeMethodDescriptionprotected JvmAbstractState<ContentT>createJvmAbstractState(JvmCfaNode programLocation, JvmFrameAbstractState<ContentT> frame, JvmHeapAbstractState<ContentT> heap, MapAbstractState<String, ContentT> staticFields) protected voidreduceHeap(JvmHeapAbstractState<ContentT> heap, JvmFrameAbstractState<ContentT> reducedFrame, MapAbstractState<String, ContentT> reducedStaticFields) Reduces the heap state.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 voidreduceStaticFields(MapAbstractState<String, ContentT> staticFields) Reduces the static fields.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface proguard.analysis.cpa.bam.ReduceOperator
onMethodEntry, reduce
-
Constructor Details
-
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 Details
-
reduceImpl
public JvmAbstractState<ContentT> reduceImpl(JvmAbstractState<ContentT> expandedInitialState, JvmCfaNode blockEntryNode, Call call) Description copied from interface:ReduceOperatorCreates the initial state of the called procedure discarding the useless information from the state of the caller.- Specified by:
reduceImplin 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
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<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<String, ContentT> staticFields)
-