|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object extended byptolemy.copernicus.c.CallGraphPruner
Class that uses the Soot Framework to find out which methods/classes are really needed for code generation.
| Field Summary | |
protected java.util.LinkedList |
_gray
The list of all classes, methods, and fields discovered but not yet processed. |
protected java.util.HashSet |
_reachableClasses
The list of all reachable classes. |
protected java.util.HashSet |
_reachableFields
The list of all reachable fields. |
protected java.util.HashSet |
_reachableMethods
The list of all reachable methods. |
| Constructor Summary | |
CallGraphPruner()
Dummy constructor to allow inheritance. |
|
CallGraphPruner(soot.SootClass source)
Constructor. |
|
| Method Summary | |
protected void |
_add(java.util.Collection nodes)
Adds a whole collection of classes/methods/fields to _gray. |
protected void |
_add(java.lang.Object node)
Adds an object to the _gray list if the object is not in the gray or a _reachable list. |
protected void |
_done(java.lang.Object node)
Adds a class, method or field to the appropriate reachable list. |
protected java.util.LinkedList |
_getCallGraphEntryPoints(soot.SootClass source)
Returns the list of methods that should be considered entry points for building the CallGraph. |
protected java.util.LinkedList |
_getCompulsoryNodes()
Returns the list of nodes(methods/classes/fields) that are always needed, regardless of whether the source class reaches them explicitly. |
protected java.util.HashSet |
_getMethodsRequiredByInheritance(java.util.Collection classSet,
java.util.Collection methodSet)
Returns the list of methods required by inheritance. |
protected java.util.HashSet |
_getNodesAccessedInBodyOf(soot.SootMethod method)
Returns a set of the nodes referenced in the body of a given method. |
protected java.util.HashSet |
_getRoots(soot.SootClass source)
Gets the set of fields, methods and classes to be started off with. |
protected void |
_growTree(soot.SootClass source)
Computes the set of classes, methods and fields reachable from a given class. |
protected boolean |
_isLeaf(soot.SootMethod method)
Figures out if a the targets of a method need to be computed. |
protected void |
_processClass(soot.SootClass node)
Performs the appropriate operations for the discovery of a new class. |
protected void |
_processField(soot.SootField field)
Performs the appropriate operations for the discovery of a new field. |
protected void |
_processMethod(soot.SootMethod method)
Performs the appropriate operations for the discovery of a new method. |
java.util.HashSet |
getReachableClasses()
Get the set of all reachable classes. |
java.util.HashSet |
getReachableFields()
Get the set of all reachable fields. |
java.util.HashSet |
getReachableMethods()
Get the set of all reachable methods. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.LinkedList _gray
protected java.util.HashSet _reachableClasses
protected java.util.HashSet _reachableFields
protected java.util.HashSet _reachableMethods
| Constructor Detail |
public CallGraphPruner()
public CallGraphPruner(soot.SootClass source)
source - The class to use as the root for the pruned tree.| Method Detail |
public java.util.HashSet getReachableClasses()
public java.util.HashSet getReachableFields()
public java.util.HashSet getReachableMethods()
protected void _add(java.util.Collection nodes)
nodes - The collection of nodes to add.protected void _add(java.lang.Object node)
node - The object to add.protected void _done(java.lang.Object node)
node - The class/field/method to process.protected java.util.LinkedList _getCallGraphEntryPoints(soot.SootClass source)
source - The main class in the Scene.
protected java.util.LinkedList _getCompulsoryNodes()
protected java.util.HashSet _getMethodsRequiredByInheritance(java.util.Collection classSet, java.util.Collection methodSet)
classSet - The set of classes that are candidates for C.methodSet - The set of methods to which I.m may belong.
protected java.util.HashSet _getNodesAccessedInBodyOf(soot.SootMethod method)
method - The method.
protected java.util.HashSet _getRoots(soot.SootClass source)
source - The source class.
protected void _growTree(soot.SootClass source)
source - The class.protected boolean _isLeaf(soot.SootMethod method)
method - The method.
protected void _processClass(soot.SootClass node)
node - The class.protected void _processField(soot.SootField field)
field - The field.protected void _processMethod(soot.SootMethod method)
method - The method.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||