| java.lang.Object EDU.purdue.cs.bloat.inline.CallGraph
CallGraph | public class CallGraph (Code) | | Grants access to certain information about a Java program. At least one root
method must be specified. From these root methods, the call graph and
information such as the classes that are instantiated during the Java program
is computed.
The construction of the call graph is in the spirit of the "Program
Virtual-call Graph" presented in [Bacon97]. However, certain changes have
been made to tailor it to BLOAT and Java and to make the overall
representation smaller.
Rapid type analysis is integrated into the construction of the call graph. A
virtual method is not examined until we know that its declaring class has
been instantiated.
Some classes are created internally by the VM and are missed by our analysis.
So, we maintain a set of "pre-live" classes. We consider all of their
constructors to be live.
|
DEBUG | public static boolean DEBUG(Code) | | |
USE1_2 | public static boolean USE1_2(Code) | | |
USEPRELIVE | public static boolean USEPRELIVE(Code) | | |
CallGraph | public CallGraph(InlineContext context, Set roots)(Code) | | Constructor.
Parameters: context - InlineContext used to examine classes and methods. Parameters: roots - The methods (represented as MemberRefs) consideredto the roots (that is, the "main" methods) of the call graph.Presumably, only static methods or constructors can be rootmethods. |
addCall | void addCall(MethodEditor callerMethod, MemberRef callee)(Code) | | Makes note of one method calling another. This does not make the method
live.
|
addClinit | void addClinit(Type type)(Code) | | Adds the static initializer for a given Type to the worklist.
|
addPreLive | public static void addPreLive(String name)(Code) | | Adds (the name of) a class to the set of classes that are considered to
be "pre-live"
|
doVirtual | void doVirtual(MethodEditor caller, MemberRef callee)(Code) | | Handles a virtual call. Determines all possible methods the call could
resolve to. Adds the method whose declaring classes are live to the
worklist. Blocks the rest on their declaring types.
|
liveClasses | public Set liveClasses()(Code) | | Returns the set of classes (Types) that are instantiated in
the program.
|
liveMethods | public Set liveMethods()(Code) | | Returns the set of methods (MemberRefs) that the
construction algorithm has deemed to be live.
|
makeLive | void makeLive(Type type)(Code) | | Marks a Type as being lives. It also unblocks any methods that
were blocked on the type.
|
print | public void print(PrintWriter out, boolean printLeaves)(Code) | | Prints a textual prepresentation of the CallGraph to a
PrintWriter.
Parameters: out - To where we print Parameters: printLeaves - If true, leaf methods (methods that do not callany other methods) are printed |
printSummary | public void printSummary(PrintWriter out)(Code) | | Prints a summary of the call graph. Including the classes that are live
and which methods are blocked.
|
removePreLive | public static boolean removePreLive(String name)(Code) | | Removes a class from the set of "pre-live" classes
true if the class was "pre-live" |
resolvesTo | public Set resolvesTo(MemberRef method)(Code) | | Returns the methods (MemberRefs) to which a given method
could resolve. Only live methods are taken into account. The methods are
sorted such that overriding methods appear before overriden methods.
|
resolvesTo | public Set resolvesTo(MemberRef method, Set rTypes)(Code) | | Returns the methods (MemberRefs) to which a given method
could resolve given that the receiver is in a certain set of types. Only
live methods are taken into account. The methods are sorted such that
overriding methods appear before overriden methods.
|
roots | public Set roots()(Code) | | Returns the root methods (MemberRefs) of the call graph.
|
|
|