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 aMethodSignature
and an offset.
-
-
Field Summary
-
Fields inherited from interface proguard.analysis.cpa.interfaces.CfaNode
EXCEPTION_EXIT_NODE_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 void
addEnteringEdge(JvmCfaEdge edge)
Adds an edge entering the node.void
addLeavingEdge(JvmCfaEdge edge)
Adds an edge leaving the node.Clazz
getClazz()
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 enteringJvmInstructionCfaEdge
for 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 leavingJvmInstructionCfaEdge
for the method invocation, empty otherwise.int
getOffset()
Returns the instruction offset.MethodSignature
getSignature()
Returns the function signature it belongs to.int
hashCode()
boolean
isEntryNode()
Checks whether the node is a function entry.boolean
isExitNode()
Checks whether the node is a function exit.java.lang.String
toString()
-
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:CfaNode
Returns a list of leaving edges.- Specified by:
getLeavingEdges
in interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
getEnteringEdges
public java.util.List<JvmCfaEdge> getEnteringEdges()
Description copied from interface:CfaNode
Returns a list of entering edges.- Specified by:
getEnteringEdges
in interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
isEntryNode
public boolean isEntryNode()
Description copied from interface:CfaNode
Checks whether the node is a function entry.- Specified by:
isEntryNode
in interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
isExitNode
public boolean isExitNode()
Description copied from interface:CfaNode
Checks whether the node is a function exit.- Specified by:
isExitNode
in interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
getSignature
public MethodSignature getSignature()
Description copied from interface:CfaNode
Returns the function signature it belongs to.- Specified by:
getSignature
in interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
getOffset
public int getOffset()
Description copied from interface:CfaNode
Returns the instruction offset.- Specified by:
getOffset
in interfaceCfaNode<JvmCfaEdge,MethodSignature>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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 enteringJvmInstructionCfaEdge
for the method invocation, empty otherwise.
-
getLeavingInvokeEdge
public java.util.Optional<JvmCfaEdge> getLeavingInvokeEdge()
If the node is the location before a method invocation, returns the leavingJvmInstructionCfaEdge
for 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:
toString
in classjava.lang.Object
-
-