Package EDU.purdue.cs.bloat.context
Class BloatContext
- java.lang.Object
-
- EDU.purdue.cs.bloat.context.BloatContext
-
- All Implemented Interfaces:
EditorContext,EDU.purdue.cs.bloat.inline.InlineContext
- Direct Known Subclasses:
PersistentBloatContext
public abstract class BloatContext extends java.lang.Object implements EDU.purdue.cs.bloat.inline.InlineContextThis abstract class is a central repository for all things that are necessary for a BLOATing sessions. Its subclasses implement certain schemes for managing BLOAT data structures such as editors and control flow graphs.
-
-
Field Summary
Fields Modifier and Type Field Description protected EDU.purdue.cs.bloat.inline.CallGraphcallGraphstatic booleanDEBUGprotected java.util.SetignoreClassesprotected java.util.SetignoreFieldsprotected java.util.SetignoreMethodsprotected java.util.SetignorePackagesprotected booleanignoreSystemprotected EDU.purdue.cs.bloat.inline.InlineStatsinlineStatsprotected ClassInfoLoaderloaderprotected java.util.Setroots
-
Constructor Summary
Constructors Constructor Description BloatContext(ClassInfoLoader loader)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddIgnoreClass(Type type)Notes that a class should be ignored by inlining.voidaddIgnoreField(MemberRef field)Notes that a field should be ignored by inlining.voidaddIgnoreMethod(MemberRef method)Notes that a method should be ignored by inlining.voidaddIgnorePackage(java.lang.String name)Notes that all classes, methods, and fields in a package should be "ignored" by inlining.abstract voidcommitDirty()Commits all classes, methods, and fields, that have been modified.protected static voiddb(java.lang.String s)EDU.purdue.cs.bloat.inline.CallGraphgetCallGraph()Returns the call graph for the program.EDU.purdue.cs.bloat.inline.InlineStatsgetInlineStats()Returns an InlineStats object for getting statistics about inlining.booleanignoreClass(Type type)Returns true if a class should be ignored by inlining.booleanignoreField(MemberRef field)Returns true if a field should be ignored by inlining.booleanignoreMethod(MemberRef method)Returns true if a method should be ignored by inlining.static booleanisSystem(Type type)Returns true if the give type is a system class (that is, has the same class loader as java.lang.String).static voidmain(java.lang.String[] args)Test the ignore stuff.voidsetIgnoreSystem(boolean ignore)Sets whether or not we ignore all system classes.voidsetRootMethods(java.util.Set roots)Sets the root methods for this InlineContext.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface EDU.purdue.cs.bloat.editor.EditorContext
commit, commit, commit, commit, editClass, editClass, editClass, editField, editField, editMethod, editMethod, getHierarchy, loadClass, newClass, newClassInfo, release, release, release
-
-
-
-
Field Detail
-
DEBUG
public static boolean DEBUG
-
inlineStats
protected EDU.purdue.cs.bloat.inline.InlineStats inlineStats
-
ignorePackages
protected java.util.Set ignorePackages
-
ignoreClasses
protected java.util.Set ignoreClasses
-
ignoreMethods
protected java.util.Set ignoreMethods
-
ignoreFields
protected java.util.Set ignoreFields
-
ignoreSystem
protected boolean ignoreSystem
-
callGraph
protected EDU.purdue.cs.bloat.inline.CallGraph callGraph
-
roots
protected java.util.Set roots
-
loader
protected ClassInfoLoader loader
-
-
Constructor Detail
-
BloatContext
public BloatContext(ClassInfoLoader loader)
Constructor. Each BloatContext needs to know about a ClassInfoLoader.
-
-
Method Detail
-
db
protected static void db(java.lang.String s)
-
isSystem
public static boolean isSystem(Type type)
Returns true if the give type is a system class (that is, has the same class loader as java.lang.String).
-
setRootMethods
public void setRootMethods(java.util.Set roots)
Description copied from interface:EDU.purdue.cs.bloat.inline.InlineContextSets the root methods for this InlineContext.- Specified by:
setRootMethodsin interfaceEDU.purdue.cs.bloat.inline.InlineContext- Parameters:
roots- The root methods (MemberRefs) of the program
-
getCallGraph
public EDU.purdue.cs.bloat.inline.CallGraph getCallGraph()
Description copied from interface:EDU.purdue.cs.bloat.inline.InlineContextReturns the call graph for the program.- Specified by:
getCallGraphin interfaceEDU.purdue.cs.bloat.inline.InlineContext
-
getInlineStats
public EDU.purdue.cs.bloat.inline.InlineStats getInlineStats()
Description copied from interface:EDU.purdue.cs.bloat.inline.InlineContextReturns an InlineStats object for getting statistics about inlining.- Specified by:
getInlineStatsin interfaceEDU.purdue.cs.bloat.inline.InlineContext
-
addIgnorePackage
public void addIgnorePackage(java.lang.String name)
Description copied from interface:EDU.purdue.cs.bloat.inline.InlineContextNotes that all classes, methods, and fields in a package should be "ignored" by inlining. That is, methods won't be inlined, classes won't be involved in specialization, etc. Note that it is exceptable to just add a prefix of a package name. For instance, adding "java" will ignore java.lang.Object, java.io.File, etc.- Specified by:
addIgnorePackagein interfaceEDU.purdue.cs.bloat.inline.InlineContext
-
addIgnoreClass
public void addIgnoreClass(Type type)
Description copied from interface:EDU.purdue.cs.bloat.inline.InlineContextNotes that a class should be ignored by inlining. That is, none of its methods will be inlined and it won't be involved in specialization.- Specified by:
addIgnoreClassin interfaceEDU.purdue.cs.bloat.inline.InlineContext
-
addIgnoreMethod
public void addIgnoreMethod(MemberRef method)
Description copied from interface:EDU.purdue.cs.bloat.inline.InlineContextNotes that a method should be ignored by inlining. That is, it will not be inlined.- Specified by:
addIgnoreMethodin interfaceEDU.purdue.cs.bloat.inline.InlineContext
-
addIgnoreField
public void addIgnoreField(MemberRef field)
Description copied from interface:EDU.purdue.cs.bloat.inline.InlineContextNotes that a field should be ignored by inlining.- Specified by:
addIgnoreFieldin interfaceEDU.purdue.cs.bloat.inline.InlineContext
-
setIgnoreSystem
public void setIgnoreSystem(boolean ignore)
Description copied from interface:EDU.purdue.cs.bloat.inline.InlineContextSets whether or not we ignore all system classes.- Specified by:
setIgnoreSystemin interfaceEDU.purdue.cs.bloat.inline.InlineContext
-
ignoreClass
public boolean ignoreClass(Type type)
Description copied from interface:EDU.purdue.cs.bloat.inline.InlineContextReturns true if a class should be ignored by inlining.- Specified by:
ignoreClassin interfaceEDU.purdue.cs.bloat.inline.InlineContext
-
ignoreMethod
public boolean ignoreMethod(MemberRef method)
Description copied from interface:EDU.purdue.cs.bloat.inline.InlineContextReturns true if a method should be ignored by inlining.- Specified by:
ignoreMethodin interfaceEDU.purdue.cs.bloat.inline.InlineContext
-
ignoreField
public boolean ignoreField(MemberRef field)
Description copied from interface:EDU.purdue.cs.bloat.inline.InlineContextReturns true if a field should be ignored by inlining.- Specified by:
ignoreFieldin interfaceEDU.purdue.cs.bloat.inline.InlineContext
-
commitDirty
public abstract void commitDirty()
Commits all classes, methods, and fields, that have been modified.
-
main
public static void main(java.lang.String[] args)
Test the ignore stuff.
-
-