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 Object implements EDU.purdue.cs.bloat.inline.InlineContext
This 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 Details

    • DEBUG

      public static boolean DEBUG
    • inlineStats

      protected EDU.purdue.cs.bloat.inline.InlineStats inlineStats
    • ignorePackages

      protected Set ignorePackages
    • ignoreClasses

      protected Set ignoreClasses
    • ignoreMethods

      protected Set ignoreMethods
    • ignoreFields

      protected Set ignoreFields
    • ignoreSystem

      protected boolean ignoreSystem
    • callGraph

      protected EDU.purdue.cs.bloat.inline.CallGraph callGraph
    • roots

      protected Set roots
    • loader

      protected ClassInfoLoader loader
  • Constructor Details

    • BloatContext

      public BloatContext(ClassInfoLoader loader)
      Constructor. Each BloatContext needs to know about a ClassInfoLoader.
  • Method Details

    • db

      protected static void db(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(Set roots)
      Description copied from interface: EDU.purdue.cs.bloat.inline.InlineContext
      Sets the root methods for this InlineContext.
      Specified by:
      setRootMethods in interface EDU.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.InlineContext
      Returns the call graph for the program.
      Specified by:
      getCallGraph in interface EDU.purdue.cs.bloat.inline.InlineContext
    • getInlineStats

      public EDU.purdue.cs.bloat.inline.InlineStats getInlineStats()
      Description copied from interface: EDU.purdue.cs.bloat.inline.InlineContext
      Returns an InlineStats object for getting statistics about inlining.
      Specified by:
      getInlineStats in interface EDU.purdue.cs.bloat.inline.InlineContext
    • addIgnorePackage

      public void addIgnorePackage(String name)
      Description copied from interface: EDU.purdue.cs.bloat.inline.InlineContext
      Notes 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:
      addIgnorePackage in interface EDU.purdue.cs.bloat.inline.InlineContext
    • addIgnoreClass

      public void addIgnoreClass(Type type)
      Description copied from interface: EDU.purdue.cs.bloat.inline.InlineContext
      Notes 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:
      addIgnoreClass in interface EDU.purdue.cs.bloat.inline.InlineContext
    • addIgnoreMethod

      public void addIgnoreMethod(MemberRef method)
      Description copied from interface: EDU.purdue.cs.bloat.inline.InlineContext
      Notes that a method should be ignored by inlining. That is, it will not be inlined.
      Specified by:
      addIgnoreMethod in interface EDU.purdue.cs.bloat.inline.InlineContext
    • addIgnoreField

      public void addIgnoreField(MemberRef field)
      Description copied from interface: EDU.purdue.cs.bloat.inline.InlineContext
      Notes that a field should be ignored by inlining.
      Specified by:
      addIgnoreField in interface EDU.purdue.cs.bloat.inline.InlineContext
    • setIgnoreSystem

      public void setIgnoreSystem(boolean ignore)
      Description copied from interface: EDU.purdue.cs.bloat.inline.InlineContext
      Sets whether or not we ignore all system classes.
      Specified by:
      setIgnoreSystem in interface EDU.purdue.cs.bloat.inline.InlineContext
    • ignoreClass

      public boolean ignoreClass(Type type)
      Description copied from interface: EDU.purdue.cs.bloat.inline.InlineContext
      Returns true if a class should be ignored by inlining.
      Specified by:
      ignoreClass in interface EDU.purdue.cs.bloat.inline.InlineContext
    • ignoreMethod

      public boolean ignoreMethod(MemberRef method)
      Description copied from interface: EDU.purdue.cs.bloat.inline.InlineContext
      Returns true if a method should be ignored by inlining.
      Specified by:
      ignoreMethod in interface EDU.purdue.cs.bloat.inline.InlineContext
    • ignoreField

      public boolean ignoreField(MemberRef field)
      Description copied from interface: EDU.purdue.cs.bloat.inline.InlineContext
      Returns true if a field should be ignored by inlining.
      Specified by:
      ignoreField in interface EDU.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(String[] args)
      Test the ignore stuff.