类 JvmCfa
- java.lang.Object
-
- proguard.analysis.cpa.defaults.Cfa<JvmCfaNode,JvmCfaEdge,MethodSignature>
-
- proguard.analysis.cpa.jvm.cfa.JvmCfa
-
public class JvmCfa extends Cfa<JvmCfaNode,JvmCfaEdge,MethodSignature>
A JVM specific implementation ofCfa.The keys of the function maps are the
MethodSignatures.The nodes of a function are identified by the offset of the code location. Besides the normal exit node for return instructions, function can also have a special exit node for uncaught exceptions.
An additional
JvmCatchCfaNodeis added for each handler in the method exception table.A unique
JvmUnknownCfaNodenode is used for instructions the successor of which is unknown.
-
-
字段概要
-
从类继承的字段 proguard.analysis.cpa.defaults.Cfa
functionNodes
-
-
构造器概要
构造器 构造器 说明 JvmCfa()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddFunctionCatchNode(MethodSignature signature, JvmCatchCfaNode node, int offset)Adds a catch node to the CFA (i.e. a node indicating the beginning of an exception handler).voidaddInterproceduralEdge(Call call)Adds a call node between two methods.JvmCfaNodeaddNodeIfAbsent(MethodSignature signature, int offset, Clazz clazz)If the requested function node is present in the graph return it.voidaddUnknownTargetInterproceduralEdge(Call call)Adds a call node between two methods.voidclear()Removes references to this CFA nodes from the singletonJvmUnknownCfaNodeand clears its node collections making it garbage collectable.booleancontainsFunctionCatchNode(MethodSignature signature, int offset)Returns true if the catch node of the specified method at the specified offset is present in the graph.java.util.stream.Stream<JvmCfaNode>getAllNodes()Returns a stream of all the nodes present in the graph.JvmCatchCfaNodegetFunctionCatchNode(MethodSignature signature, int offset)Returns the catch node of a method the handler of which begins at the specific code offset, returns null if the method or the specific catch node are not in the graph.java.util.Collection<JvmCatchCfaNode>getFunctionCatchNodes(MethodSignature signature)Returns all the catch nodes of a specific method, returns an empty collection if the function is not in the graph or if it has no catch nodes.JvmCfaNodegetFunctionExceptionExitNode(MethodSignature signature, Clazz clazz)Returns the exception exit node (i.e. the exit node in case of not caught exception) of the specified method if present, otherwise creates the exit node for the method and returns it.JvmCfaNodegetFunctionReturnExitNode(MethodSignature signature, Clazz clazz)Returns the exit node of the specified method if present, otherwise creates the exit node for the method and returns it.-
从类继承的方法 proguard.analysis.cpa.defaults.Cfa
addFunctionEntryNode, addFunctionNode, getFunctionEntryNode, getFunctionEntryNodes, getFunctionNode, getFunctionNode, getFunctionNodes, isEmpty
-
-
-
-
方法详细资料
-
getAllNodes
public java.util.stream.Stream<JvmCfaNode> getAllNodes()
从类复制的说明:CfaReturns a stream of all the nodes present in the graph.Note: a
Streamis provided to avoid creating new collections unnecessarily.- 覆盖:
getAllNodes在类中Cfa<JvmCfaNode,JvmCfaEdge,MethodSignature>
-
getFunctionCatchNodes
public java.util.Collection<JvmCatchCfaNode> getFunctionCatchNodes(MethodSignature signature)
Returns all the catch nodes of a specific method, returns an empty collection if the function is not in the graph or if it has no catch nodes.- 参数:
signature- The signature of the method.
-
getFunctionCatchNode
public JvmCatchCfaNode getFunctionCatchNode(MethodSignature signature, int offset)
Returns the catch node of a method the handler of which begins at the specific code offset, returns null if the method or the specific catch node are not in the graph.- 参数:
signature- The signature of the method, might be different for different domains.offset- The offset of the catch handler represented by the node.
-
addFunctionCatchNode
public void addFunctionCatchNode(MethodSignature signature, JvmCatchCfaNode node, int offset)
Adds a catch node to the CFA (i.e. a node indicating the beginning of an exception handler).
-
containsFunctionCatchNode
public boolean containsFunctionCatchNode(MethodSignature signature, int offset)
Returns true if the catch node of the specified method at the specified offset is present in the graph.
-
getFunctionReturnExitNode
public JvmCfaNode getFunctionReturnExitNode(MethodSignature signature, Clazz clazz)
Returns the exit node of the specified method if present, otherwise creates the exit node for the method and returns it.
-
getFunctionExceptionExitNode
public JvmCfaNode getFunctionExceptionExitNode(MethodSignature signature, Clazz clazz)
Returns the exception exit node (i.e. the exit node in case of not caught exception) of the specified method if present, otherwise creates the exit node for the method and returns it.
-
addNodeIfAbsent
public JvmCfaNode addNodeIfAbsent(MethodSignature signature, int offset, Clazz clazz)
If the requested function node is present in the graph return it. If the node is not present add it to the graph and return the new node.
-
addInterproceduralEdge
public void addInterproceduralEdge(Call call)
Adds a call node between two methods.
-
addUnknownTargetInterproceduralEdge
public void addUnknownTargetInterproceduralEdge(Call call)
Adds a call node between two methods. This is used when the target method has noCodeAttribute, which means the target method is not present in the CFA. The unknown node is set as the call target.
-
clear
public void clear()
Removes references to this CFA nodes from the singletonJvmUnknownCfaNodeand clears its node collections making it garbage collectable.
-
-