Class AbstractHeapModel

java.lang.Object
pascal.taie.analysis.pta.core.heap.AbstractHeapModel
All Implemented Interfaces:
Serializable, HeapModel, Indexer<Obj>
Direct Known Subclasses:
AllocationSiteBasedModel

public abstract class AbstractHeapModel extends Object implements HeapModel
All heap models should inherit this class, and we can define some uniform behaviors of heap modeling here.
See Also:
  • Constructor Details

  • Method Details

    • getObj

      public Obj getObj(New allocSite)
      Specified by:
      getObj in interface HeapModel
      Returns:
      the abstract object for given new statement.
    • getMergedObj

      protected MergedObj getMergedObj(New allocSite)
      Merges given object given by its type.
      Parameters:
      allocSite - the allocation site of the object
      Returns:
      the merged object
    • getNewObj

      protected NewObj getNewObj(New allocSite)
    • doGetObj

      protected abstract Obj doGetObj(New allocSite)
      The method which controls the heap modeling for normal objects.
    • getConstantObj

      public Obj getConstantObj(ReferenceLiteral value)
      Specified by:
      getConstantObj in interface HeapModel
      Returns:
      the constant object for given value.
    • doGetConstantObj

      protected Obj doGetConstantObj(ReferenceLiteral value)
    • isStringConstant

      public boolean isStringConstant(Obj obj)
      Specified by:
      isStringConstant in interface HeapModel
      Returns:
      true if obj represents a string constant.
    • getMockObj

      public Obj getMockObj(Descriptor desc, Object alloc, Type type, JMethod container, boolean isFunctional)
      Specified by:
      getMockObj in interface HeapModel
    • add

      protected <T extends Obj> T add(T obj)
      Adds an obj to this model. This method also sets index for given obj. Each obj should be passed to this method only once.
    • getObjects

      public Collection<Obj> getObjects()
      Specified by:
      getObjects in interface HeapModel
      Returns:
      all objects in this heap model.
    • getIndex

      public int getIndex(Obj o)
      Specified by:
      getIndex in interface Indexer<Obj>
      Returns:
      the index of the given object.
    • getObject

      public Obj getObject(int index)
      Specified by:
      getObject in interface Indexer<Obj>
      Returns:
      the corresponding object of the given index.