accrue.analysis.pointer.analyses

## Class HeapAbstractionFactory

- java.lang.Object
- - accrue.analysis.pointer.analyses.HeapAbstractionFactory

- Direct Known Subclasses:
    CallSiteContextSensitiveAnalysis, CallSiteForPattern, CrossProductAnalysis, DistinguishClass, FullObjSensitiveAnalysis, StaticCallSiteContextSensitiveAnalysis, StickFirstMatches, TypeSensitive_nTmH_Analysis

      public abstract class HeapAbstractionFactory
      extends java.lang.Object

  A HeapAbstractionFactory is responsible for providing an appropriate abstraction of the heap for pointer analysis. It is based on the factoring of pointer analysis in the paper "Pick Your Contexts Well: Understanding Object-Sensitivity" by Smaragdakis, Bravenboer, and Lhotak, POPL 2011.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HeapAbstractionFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearMemoization()`
    `CContext` | `fixContextForReferenceVariable(CContext context, ReferenceVariable r)` Fix the code context for a reference variable, if needed, when creating a reference variable replica for reference variable `r`.
    `void` | `init()` Initialize the factory.
    `CContext` | `initialContext()` Return the initial CContext, i.e., to analyze the main method.
    `protected abstract CContext` | `initialContextImpl()` Return the initial CContext, i.e., to analyze the main method.
    `protected static CContext` | `memoize(CContext o)`
    `protected static HContext` | `memoize(HContext o)`
    `CContext` | `merge(CallSiteNode callSite, HContext receiver, CContext callerContext)` Produce a code context (i.e., CContext) to analysis code called from call site `callSite` in code context `callerContext`, where `receiver` is the abstract object for the receiver of the method invocation.
    `protected abstract CContext` | `mergeImpl(CallSiteNode callSite, HContext receiver, CContext callerContext)` Produce a code context (i.e., CContext) to analysis code called from call site `callSite` in code context `callerContext`, where `receiver` is the abstract object for the recevier of the method invocation.
    `HContext` | `record(CContext context, AllocSiteNode alloc)` Produce an abstract object (i.e., HContext) to represent an object created at allocation site `alloc` in code context `context`.
    `protected abstract HContext` | `recordImpl(CContext context, AllocSiteNode alloc)` Produce an abstract object (i.e., HContext) to represent an object created at allocation site `alloc` in code context `context`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HeapAbstractionFactory

          public HeapAbstractionFactory()

  - ### Method Detail

    - #### record

          public final HContext record(CContext context,
                        AllocSiteNode alloc)

      Produce an abstract object (i.e., HContext) to represent an object created at allocation site `alloc` in code context `context`. This method wraps recordImpl to enforce memoization.

    - #### recordImpl

          protected abstract HContext recordImpl(CContext context,
                            AllocSiteNode alloc)

      Produce an abstract object (i.e., HContext) to represent an object created at allocation site `alloc` in code context `context`.

    - #### merge

          public final CContext merge(CallSiteNode callSite,
                       HContext receiver,
                       CContext callerContext)

      Produce a code context (i.e., CContext) to analysis code called from call site `callSite` in code context `callerContext`, where `receiver` is the abstract object for the receiver of the method invocation. If the method being called does not have a receiver (i.e., it is a static method), then `receiver` will be null. This method wraps mergeImpl to enforce memoization.

    - #### mergeImpl

          protected abstract CContext mergeImpl(CallSiteNode callSite,
                           HContext receiver,
                           CContext callerContext)

      Produce a code context (i.e., CContext) to analysis code called from call site `callSite` in code context `callerContext`, where `receiver` is the abstract object for the recevier of the method invocation. If the method being called does not have a receiver (i.e., it is a static method), then `receiver` will be null.

    - #### fixContextForReferenceVariable

          public CContext fixContextForReferenceVariable(CContext context,
                                                ReferenceVariable r)

      Fix the code context for a reference variable, if needed, when creating a reference variable replica for reference variable `r`. The need for this method is motivated by an object sensitive analysis where static fields should only have a single replica, i.e., if f is a static field of C, and o is an object of class C, then an expression o.f should be represented by a reference variable replica that has the ObjectField for C.f in the unique static context, not the context for o.

    - #### initialContext

          public final CContext initialContext()

      Return the initial CContext, i.e., to analyze the main method. This method wraps initialContextImpl to enforce memoization.

    - #### initialContextImpl

          protected abstract CContext initialContextImpl()

      Return the initial CContext, i.e., to analyze the main method.

    - #### init

          public void init()

      Initialize the factory.

    - #### memoize

          protected static HContext memoize(HContext o)

    - #### memoize

          protected static CContext memoize(CContext o)

    - #### clearMemoization

          public void clearMemoization()