Class PersistentBloatContext
java.lang.Object
EDU.purdue.cs.bloat.context.BloatContext
EDU.purdue.cs.bloat.context.PersistentBloatContext
- All Implemented Interfaces:
EditorContext, EDU.purdue.cs.bloat.inline.InlineContext
- Direct Known Subclasses:
CachingBloatContext
Maintains all BLOAT data structures as if they were meant to reside in a
persistent store. As a result, it keeps every piece of BLOAT data around
because it might be needed in the future. No fancing cache maintainence is
performed. Because we are going for maximum information we take the closure
of classes when working with the class hierarchy.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Mapprotected Mapstatic booleanprotected Mapprotected Mapprotected final ClassHierarchyprotected Mapprotected MapFields inherited from class BloatContext
callGraph, DEBUG, ignoreClasses, ignoreFields, ignoreMethods, ignorePackages, ignoreSystem, inlineStats, loader, roots -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructor.protectedPersistentBloatContext(ClassInfoLoader loader, boolean closure) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddClasses(Collection classes) Adds a bunch of (names of) classes to the hierarchy.protected static voidvoidcommit()Commits all changes made to classes, methods, and fields.voidClasses that are ignored are not committed.voidCommits the changes made to a field.voidcommit(MethodInfo info) Commits the changes made to a method.voidCommits all classes, methods, and fields, that have been modified.Returns a ClassEditor used to edit a class described by a given Type.Returns a ClassEditor used to edit a class described by a given ClassInfo.Returns a ClassEditor used to edit a class of a given name.Returns a FieldEditor for editing a field.Returns a FieldEditor for editing a FieldInfo.editMethod(MemberRef method) Returns a MethodEditor for editing a method.editMethod(MethodInfo info) Returns a MethodEditor for editing a method.Returns the ClassHierarchy of all classes and interfaces known to BLOAT.Loads a class into BLOATReturns aClassEditorfor editing a new class with the given name.newClassInfo(int modifiers, int classIndex, int superClassIndex, int[] interfaceIndexes, List constants) Creates a newClassInfovoidrelease(ClassEditor ce) voidSignals that we are done editing a class.voidSignals that we are done editing a field.voidrelease(MethodInfo info) Signals that we are done editing a method.Methods inherited from class BloatContext
addIgnoreClass, addIgnoreField, addIgnoreMethod, addIgnorePackage, db, getCallGraph, getInlineStats, ignoreClass, ignoreField, ignoreMethod, isSystem, main, setIgnoreSystem, setRootMethods
-
Field Details
-
hierarchy
-
classInfos
-
methodInfos
-
fieldInfos
-
classEditors
-
methodEditors
-
fieldEditors
-
DB_COMMIT
public static boolean DB_COMMIT
-
-
Constructor Details
-
PersistentBloatContext
Constructor. Each BloatContext stems from a ClassInfoLoader. Using the loader it can create an Editor and such. Initially, no classes are loaded. -
PersistentBloatContext
Constructor. It is the responsibility of the subclasses to add classes to the hierarchy by calling addClasses.- Parameters:
loader- Used to load classesclosure- Do we look for the maximum number of classes?
-
-
Method Details
-
comm
-
addClasses
Adds a bunch of (names of) classes to the hierarchy. -
loadClass
Description copied from interface:EditorContextLoads a class into BLOAT- Throws:
ClassNotFoundException
-
newClassInfo
public ClassInfo newClassInfo(int modifiers, int classIndex, int superClassIndex, int[] interfaceIndexes, List constants) Description copied from interface:EditorContextCreates a newClassInfo- Parameters:
modifiers- The modifiers describing the newly-created classclassIndex- The index of the name of the newly-created class in its constant poolsuperClassIndex- The index of the name of the newly-created class's superclass in its constant poolinterfaceIndexes- The indexes of the names of the interfaces that the newly-created class implementsconstants- The constant pool for the newly created class (a list ofConstants).
-
getHierarchy
Description copied from interface:EditorContextReturns the ClassHierarchy of all classes and interfaces known to BLOAT. -
newClass
Description copied from interface:EditorContextReturns aClassEditorfor editing a new class with the given name. It will override any class with the given name that is already being edited. -
editClass
Description copied from interface:EditorContextReturns a ClassEditor used to edit a class of a given name. -
editClass
Description copied from interface:EditorContextReturns a ClassEditor used to edit a class described by a given Type. -
editClass
Description copied from interface:EditorContextReturns a ClassEditor used to edit a class described by a given ClassInfo. -
editMethod
Description copied from interface:EditorContextReturns a MethodEditor for editing a method.- Throws:
NoSuchMethodException
-
editMethod
Description copied from interface:EditorContextReturns a MethodEditor for editing a method. -
editField
Description copied from interface:EditorContextReturns a FieldEditor for editing a field.- Throws:
NoSuchFieldException
-
editField
Description copied from interface:EditorContextReturns a FieldEditor for editing a FieldInfo. -
release
Description copied from interface:EditorContextSignals that we are done editing a class. The object used to model it may be reclaimed. -
release
-
release
Description copied from interface:EditorContextSignals that we are done editing a method. The object used to model it may be reclaimed. -
release
Description copied from interface:EditorContextSignals that we are done editing a field. The object used to model it may be reclaimed. -
commit
-
commit
Description copied from interface:EditorContextCommits the changes made to a method. -
commit
Description copied from interface:EditorContextCommits the changes made to a field. -
commit
public void commit()Description copied from interface:EditorContextCommits all changes made to classes, methods, and fields. -
commitDirty
public void commitDirty()Description copied from class:BloatContextCommits all classes, methods, and fields, that have been modified.- Specified by:
commitDirtyin classBloatContext
-