Class JvmCfaNode
- java.lang.Object
-
- proguard.analysis.cpa.jvm.cfa.nodes.JvmCfaNode
-
- All Implemented Interfaces:
CfaNode<JvmCfaEdge,MethodSignature>
- Direct Known Subclasses:
JvmCatchCfaNode,JvmUnknownCfaNode
public class JvmCfaNode extends java.lang.Object implements CfaNode<JvmCfaEdge,MethodSignature>
A node representing a code location of a JVM method identified by aMethodSignatureand an offset.
-
-
Field Summary
-
Fields inherited from interface proguard.analysis.cpa.interfaces.CfaNode
EXCEPTION_EXIT_NODE_OFFSET, EXIT_NODES_OFFSET, RETURN_EXIT_NODE_OFFSET
-
-
Constructor Summary
Constructors Constructor Description JvmCfaNode(java.util.List<JvmCfaEdge> leavingEdges, java.util.List<JvmCfaEdge> enteringEdges, MethodSignature signature, int offset, Clazz clazz)Create JVM CFA node with the specified entering and exiting edges.JvmCfaNode(MethodSignature signature, int offset, Clazz clazz)Create a JVM CFA node without edges.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEnteringEdge(JvmCfaEdge edge)Adds an edge entering the node.voidaddLeavingEdge(JvmCfaEdge edge)Adds an edge leaving the node.ClazzgetClazz()Returns the class the node belongs to.java.util.List<JvmCfaEdge>getEnteringEdges()Returns a list of entering edges.java.util.Collection<JvmCfaEdge>getEnteringIntraproceduralEdges()Returns the edges entering the node that do not come from another method.java.util.Optional<JvmCfaEdge>getEnteringInvokeEdge()If the node is the location after a method invocation, returns the enteringJvmInstructionCfaEdgefor the method invocation, empty otherwise.java.util.Collection<JvmCallCfaEdge>getKnownMethodCallEdges()Returns all the interprocedural call edges leaving the node with target method the code of which is known.java.util.List<JvmCfaEdge>getLeavingEdges()Returns a list of leaving edges.java.util.Collection<JvmCallCfaEdge>getLeavingInterproceduralEdges()Returns the edges entering the node that come from another method.java.util.Collection<JvmCfaEdge>getLeavingIntraproceduralEdges()Returns the edges leaving the node that do not come from another method.java.util.Optional<JvmCfaEdge>getLeavingInvokeEdge()If the node is the location before a method invocation, returns the leavingJvmInstructionCfaEdgefor the method invocation, empty otherwise.intgetOffset()Returns the instruction offset.MethodSignaturegetSignature()Returns the function signature it belongs to.inthashCode()booleanisEntryNode()Checks whether the node is a function entry.booleanisExitNode()Checks whether the node is a function exit.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface proguard.analysis.cpa.interfaces.CfaNode
isExceptionExitNode, isReturnExitNode, isUnknownNode
-
-
-
-
Constructor Detail
-
JvmCfaNode
public JvmCfaNode(MethodSignature signature, int offset, Clazz clazz)
Create a JVM CFA node without edges. Since in most cases we expect to have just one element in the lists of leaving and entering edges the lists are initialized with size 1.- Parameters:
signature- the signature of the method the node belongs tooffset- a number indicating the program location offset of the nodeclazz- the class of the method the node belongs to
-
JvmCfaNode
public JvmCfaNode(java.util.List<JvmCfaEdge> leavingEdges, java.util.List<JvmCfaEdge> enteringEdges, MethodSignature signature, int offset, Clazz clazz)
Create JVM CFA node with the specified entering and exiting edges.- Parameters:
leavingEdges- a list of edges leaving the nodeenteringEdges- a list of edges entering the nodesignature- the signature of the method the node belongs tooffset- a number indicating the program location offset of the nodeclazz- the class of the method the node belongs to
-
-
Method Detail
-
getLeavingEdges
public java.util.List<JvmCfaEdge> getLeavingEdges()
Description copied from interface:CfaNodeReturns a list of leaving edges.- Specified by:
getLeavingEdgesin interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
getEnteringEdges
public java.util.List<JvmCfaEdge> getEnteringEdges()
Description copied from interface:CfaNodeReturns a list of entering edges.- Specified by:
getEnteringEdgesin interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
isEntryNode
public boolean isEntryNode()
Description copied from interface:CfaNodeChecks whether the node is a function entry.- Specified by:
isEntryNodein interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
isExitNode
public boolean isExitNode()
Description copied from interface:CfaNodeChecks whether the node is a function exit.- Specified by:
isExitNodein interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
getSignature
public MethodSignature getSignature()
Description copied from interface:CfaNodeReturns the function signature it belongs to.- Specified by:
getSignaturein interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
getOffset
public int getOffset()
Description copied from interface:CfaNodeReturns the instruction offset.- Specified by:
getOffsetin interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getClazz
public Clazz getClazz()
Returns the class the node belongs to.
-
addLeavingEdge
public void addLeavingEdge(JvmCfaEdge edge)
Adds an edge leaving the node.
-
addEnteringEdge
public void addEnteringEdge(JvmCfaEdge edge)
Adds an edge entering the node.
-
getEnteringInvokeEdge
public java.util.Optional<JvmCfaEdge> getEnteringInvokeEdge()
If the node is the location after a method invocation, returns the enteringJvmInstructionCfaEdgefor the method invocation, empty otherwise.
-
getLeavingInvokeEdge
public java.util.Optional<JvmCfaEdge> getLeavingInvokeEdge()
If the node is the location before a method invocation, returns the leavingJvmInstructionCfaEdgefor the method invocation, empty otherwise.
-
getEnteringIntraproceduralEdges
public java.util.Collection<JvmCfaEdge> getEnteringIntraproceduralEdges()
Returns the edges entering the node that do not come from another method.
-
getLeavingIntraproceduralEdges
public java.util.Collection<JvmCfaEdge> getLeavingIntraproceduralEdges()
Returns the edges leaving the node that do not come from another method.
-
getLeavingInterproceduralEdges
public java.util.Collection<JvmCallCfaEdge> getLeavingInterproceduralEdges()
Returns the edges entering the node that come from another method.
-
getKnownMethodCallEdges
public java.util.Collection<JvmCallCfaEdge> getKnownMethodCallEdges()
Returns all the interprocedural call edges leaving the node with target method the code of which is known.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-