|
|||||||||
| Home >> All >> Compil3r >> [ Quad overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
Compil3r.Quad
Class MethodSummary

java.lang.ObjectCompil3r.Quad.MethodSummary
- public class MethodSummary
- extends java.lang.Object
- Version:
- $Id: MethodSummary.java,v 1.64 2003/08/12 12:06:33 joewhaley Exp $
| Nested Class Summary | |
static class |
MethodSummary.AccessPath
Encodes an access path. |
static class |
MethodSummary.BuildMethodSummary
Visitor class to build an intramethod summary. |
static class |
MethodSummary.CallSite
|
static class |
MethodSummary.ConcreteObjectNode
A ConcreteObjectNode refers to an object that we discovered through reflection. |
static class |
MethodSummary.ConcreteTypeNode
A ConcreteTypeNode refers to an object with a concrete type. |
static class |
MethodSummary.Edge
|
static class |
MethodSummary.FieldNode
A FieldNode represents the result of a 'load' instruction. |
static class |
MethodSummary.GlobalNode
A GlobalNode stores references to the static variables. |
static class |
MethodSummary.MethodSummaryBuilder
|
static class |
MethodSummary.Node
|
static class |
MethodSummary.NodeSet
|
static class |
MethodSummary.OutsideNode
An outside node is some node that can be mapped to other nodes. |
static class |
MethodSummary.ParamNode
A ParamNode represents an incoming parameter. |
static class |
MethodSummary.PassedParameter
Represents a particular parameter passed to a particular method call. |
static class |
MethodSummary.ReturnedNode
A ReturnedNode represents a return value or thrown exception from a method call. |
static class |
MethodSummary.ReturnValueNode
A ReturnValueNode represents the return value of a method call. |
static class |
MethodSummary.State
Records the state of the intramethod analysis at some point in the method. |
static class |
MethodSummary.ThrownExceptionNode
A ThrownExceptionNode represents the thrown exception of a method call. |
static class |
MethodSummary.UnknownTypeNode
A UnknownTypeNode refers to an object with an unknown type. |
| Field Summary | |
(package private) java.util.Set |
calls
The method calls that this method makes. |
(package private) java.util.Map |
callToRVN
Map from a method call that this method makes, and its ReturnValueNode. |
(package private) java.util.Map |
callToTEN
Map from a method call that this method makes, and its ThrownExceptionNode. |
static java.util.HashMap |
clone_cache
|
static boolean |
DETERMINISTIC
|
(package private) MethodSummary.GlobalNode |
global
The global node. |
static boolean |
IGNORE_INSTANCE_FIELDS
|
static boolean |
IGNORE_STATIC_FIELDS
|
(package private) Compil3r.Quad.AndersenInterface.AndersenMethod |
method
The method that this is a summary for. |
(package private) java.util.Map |
nodes
All nodes in the summary graph. |
static java.io.PrintStream |
out
|
(package private) MethodSummary.ParamNode[] |
params
The parameter nodes. |
(package private) java.util.Map |
passedParamToNodes
|
(package private) java.util.Set |
returned
The returned nodes. |
static java.util.HashMap |
summary_cache
|
(package private) java.util.Set |
thrown
The thrown nodes. |
static boolean |
TRACE_INST
|
static boolean |
TRACE_INTER
|
static boolean |
TRACE_INTRA
|
static boolean |
UNIFY_ACCESS_PATHS
|
static boolean |
USE_IDENTITY_HASHCODE
|
static boolean |
USE_PARAMETER_MAP
|
static boolean |
VERIFY_ASSERTIONS
|
| Constructor Summary | |
|
MethodSummary(Compil3r.Quad.AndersenInterface.AndersenMethod method,
MethodSummary.ParamNode[] param_nodes,
MethodSummary.GlobalNode my_global,
java.util.Set methodCalls,
java.util.HashMap callToRVN,
java.util.HashMap callToTEN,
java.util.Set returned,
java.util.Set thrown,
java.util.Set passedAsParameters)
|
private |
MethodSummary(Compil3r.Quad.AndersenInterface.AndersenMethod method,
MethodSummary.ParamNode[] params,
java.util.Set methodCalls,
java.util.HashMap callToRVN,
java.util.HashMap callToTEN,
java.util.Map passedParamToNodes,
java.util.Set returned,
java.util.Set thrown,
java.util.Map nodes)
|
(package private) |
MethodSummary(MethodSummary.ParamNode[] param_nodes)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
out
public static java.io.PrintStream out
TRACE_INTRA
public static boolean TRACE_INTRA
TRACE_INTER
public static boolean TRACE_INTER
TRACE_INST
public static boolean TRACE_INST
IGNORE_INSTANCE_FIELDS
public static final boolean IGNORE_INSTANCE_FIELDS
- See Also:
- Constant Field Values
IGNORE_STATIC_FIELDS
public static final boolean IGNORE_STATIC_FIELDS
- See Also:
- Constant Field Values
VERIFY_ASSERTIONS
public static final boolean VERIFY_ASSERTIONS
- See Also:
- Constant Field Values
USE_IDENTITY_HASHCODE
public static final boolean USE_IDENTITY_HASHCODE
- See Also:
- Constant Field Values
DETERMINISTIC
public static final boolean DETERMINISTIC
- See Also:
- Constant Field Values
summary_cache
public static java.util.HashMap summary_cache
clone_cache
public static java.util.HashMap clone_cache
method
final Compil3r.Quad.AndersenInterface.AndersenMethod method
- The method that this is a summary for.
params
final MethodSummary.ParamNode[] params
- The parameter nodes.
nodes
final java.util.Map nodes
- All nodes in the summary graph.
returned
final java.util.Set returned
- The returned nodes.
thrown
final java.util.Set thrown
- The thrown nodes.
global
MethodSummary.GlobalNode global
- The global node.
calls
final java.util.Set calls
- The method calls that this method makes.
callToRVN
final java.util.Map callToRVN
- Map from a method call that this method makes, and its ReturnValueNode.
callToTEN
final java.util.Map callToTEN
- Map from a method call that this method makes, and its ThrownExceptionNode.
USE_PARAMETER_MAP
public static final boolean USE_PARAMETER_MAP
- See Also:
- Constant Field Values
passedParamToNodes
final java.util.Map passedParamToNodes
UNIFY_ACCESS_PATHS
public static final boolean UNIFY_ACCESS_PATHS
- See Also:
- Constant Field Values
| Constructor Detail |
MethodSummary
MethodSummary(MethodSummary.ParamNode[] param_nodes)
MethodSummary
public MethodSummary(Compil3r.Quad.AndersenInterface.AndersenMethod method, MethodSummary.ParamNode[] param_nodes, MethodSummary.GlobalNode my_global, java.util.Set methodCalls, java.util.HashMap callToRVN, java.util.HashMap callToTEN, java.util.Set returned, java.util.Set thrown, java.util.Set passedAsParameters)
MethodSummary
private MethodSummary(Compil3r.Quad.AndersenInterface.AndersenMethod method, MethodSummary.ParamNode[] params, java.util.Set methodCalls, java.util.HashMap callToRVN, java.util.HashMap callToTEN, java.util.Map passedParamToNodes, java.util.Set returned, java.util.Set thrown, java.util.Map nodes)
| Method Detail |
getSummary
public static MethodSummary getSummary(ControlFlowGraph cfg)
clearSummaryCache
public static void clearSummaryCache()
getSummary
public static MethodSummary getSummary(ControlFlowGraph cfg, MethodSummary.CallSite cs)
readNode
public static MethodSummary.Node readNode(java.util.StringTokenizer st) throws java.io.IOException
writeType
public static void writeType(java.io.DataOutput out, Clazz.jq_Reference type) throws java.io.IOException
readType
public static Clazz.jq_Reference readType(java.util.StringTokenizer st)
writeMember
public static void writeMember(java.io.DataOutput out, Clazz.jq_Member m) throws java.io.IOException
readMember
public static Clazz.jq_Member readMember(java.util.StringTokenizer st)
writeQuad
public static void writeQuad(java.io.DataOutput out, Clazz.jq_Method m, Quad q) throws java.io.IOException
readQuad
public static Quad readQuad(java.util.StringTokenizer st, java.lang.Class op)
writeLocation
public static void writeLocation(java.io.DataOutput out, ProgramLocation l) throws java.io.IOException
readLocation
public static ProgramLocation readLocation(java.util.StringTokenizer st) throws java.io.IOException
getGlobal
public MethodSummary.GlobalNode getGlobal()
getParamNode
public MethodSummary.ParamNode getParamNode(int i)
getNumOfParams
public int getNumOfParams()
getCalls
public java.util.Set getCalls()
getNodesThatCall
public void getNodesThatCall(MethodSummary.PassedParameter pp, java.util.Set result)
- Add all nodes that are passed as the given passed parameter to the given result set.
getNodesThatCall
public java.util.Set getNodesThatCall(MethodSummary.PassedParameter pp)
mergeGlobal
public void mergeGlobal()
addToMultiMap
public static boolean addToMultiMap(java.util.HashMap mm, java.lang.Object from, java.lang.Object to)
- Utility function to add to a multi map.
addToMultiMap
public static boolean addToMultiMap(java.util.HashMap mm, java.lang.Object from, java.util.Set to)
- Utility function to add to a multi map.
get_mapping
static java.util.Set get_mapping(java.util.HashMap callee_to_caller, MethodSummary.Node callee_n)
- Utility function to get the mapping for a callee node.
copy
public MethodSummary copy()
- Return a deep copy of this analysis summary.
Nodes, edges, everything is copied.
unifyAccessPaths
public void unifyAccessPaths(java.util.Set roots)
- Unify similar access paths from the given roots.
The given set is consumed.
unifyAccessPathEdges
public void unifyAccessPathEdges(MethodSummary.Node n)
- Unify similar access path edges from the given node.
instantiate
public static void instantiate(MethodSummary caller, ProgramLocation mc, MethodSummary callee, boolean removeCall)
- Instantiate a copy of the callee summary into the caller.
getMethod
public Compil3r.Quad.AndersenInterface.AndersenMethod getMethod()
hashCode
public int hashCode()
- Description copied from class:
java.lang.Object - Get a value that represents this Object, as uniquely as
possible within the confines of an int.
There are some requirements on this method which subclasses must follow:
- Semantic equality implies identical hashcodes. In other
words, if
a.equals(b)is true, thena.hashCode() == b.hashCode()must be as well. However, the reverse is not necessarily true, and two objects may have the same hashcode without being equal. - It must be consistent. Whichever value o.hashCode() returns on the first invocation must be the value returned on all later invocations as long as the object exists. Notice, however, that the result of hashCode may change between separate executions of a Virtual Machine, because it is not invoked on the same object.
Notice that since
hashCodeis used in java.util.Hashtable and other hashing classes, a poor implementation will degrade the performance of hashing (so don't blindly implement it as returning a constant!). Also, if calculating the hash is time-consuming, a class may consider caching the results.The default implementation returns
System.identityHashCode(this) - Semantic equality implies identical hashcodes. In other
words, if
toString
public java.lang.String toString()
- Return a string representation of this summary.
addIfUseful
private boolean addIfUseful(java.util.HashSet visited, java.util.HashSet path, MethodSummary.Node n)
- Utility function to add the given node to the node set if it is useful,
and transitively for other nodes.
addAsUseful
private void addAsUseful(java.util.HashSet visited, java.util.HashSet path, MethodSummary.Node n)
- Utility function to add the given node to the node set as useful,
and transitively for other nodes.
nodeIterator
public java.util.Iterator nodeIterator()
- Returns an iteration of all nodes in this summary.
getReturned
public java.util.Set getReturned()
getThrown
public java.util.Set getThrown()
getRVN
public MethodSummary.ReturnValueNode getRVN(ProgramLocation mc)
getTEN
public MethodSummary.ThrownExceptionNode getTEN(ProgramLocation mc)
verify
void verify()
multiset_contains
static boolean multiset_contains(java.util.Map m, java.lang.Object o)
verifyNoReferences
void verifyNoReferences(MethodSummary.Node n)
getLocationOf
ProgramLocation getLocationOf(MethodSummary.ConcreteTypeNode n)
getLocationOf
java.util.Collection getLocationOf(MethodSummary.FieldNode n)
dotGraph
void dotGraph(java.io.DataOutput out) throws java.io.IOException
|
|||||||||
| Home >> All >> Compil3r >> [ Quad overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
Compil3r.Quad.MethodSummary