accrue.analysis.antidep

## Class AntiDepAnalysisUtil

- java.lang.Object
- - accrue.analysis.interprocanalysis.AnalysisUtil<A>
  - - accrue.analysis.interprocvarcontext.AnalysisUtilVarContext<A,T>
    - - accrue.analysis.interprocvarcontext.AnalysisUtilVarContextDataFlow<VarContext<AntiDepAbsVal>,AntiDepAbsVal>
      - - accrue.analysis.antidep.AntiDepAnalysisUtil

-     public class AntiDepAnalysisUtil
      extends AnalysisUtilVarContextDataFlow<VarContext<AntiDepAbsVal>,AntiDepAbsVal>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected polyglot.types.TypeSystem` | `ts`

    - ### Fields inherited from class accrue.analysis.interprocvarcontext.AnalysisUtilVarContext

      `trackErrors`

    - ### Fields inherited from class accrue.analysis.interprocanalysis.AnalysisUtil

      `extInfo, instanceInitializersChecked, workQueue`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AntiDepAnalysisUtil(WorkQueue<VarContext<AntiDepAbsVal>> wq, AnalysisUnit currentAnalysisUnit, AccrueExtensionInfo extInfo)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.util.Set<AbstractLocation>` | `abstractLocations(AntiDepAbsVal arrayDFI, polyglot.ast.ArrayAccess aa)`
    `protected java.util.Set<AbstractLocation>` | `abstractLocations(AntiDepAbsVal targetDFI, polyglot.ast.Field f)`
    `FinalVarContext<AntiDepAbsVal>` | `analyze(polyglot.ast.CodeNode n, VarContext<AntiDepAbsVal> input)` Analyze the given code with the given current analysis results
    `FinalVarContext<AntiDepAbsVal>` | `analyzeInitializersForDataFlow(VarContext<AntiDepAbsVal> before)` Analyze the initializers for the current analysis unit given the current analysis results
    `AntiDepAbsVal` | `bottomAbstractValue()`
    `FinalVarContext<AntiDepAbsVal>` | `callNonVirtual(polyglot.types.ProcedureInstance pi, AnalysisContext calleeContext, HContext receiver, AntiDepAbsVal receiverAbsVal, VarContext<AntiDepAbsVal> input, DataFlowNodeIdentifier callSite, boolean canTerminateNormally)` Process a call to a non-virtual call to `pi` with `VarContext` `input`.
    `VarContext<AntiDepAbsVal>` | `createInitContext()` Create an initial variable context
    `protected FinalVarContext<AntiDepAbsVal>` | `getAnalysisResultsFromWorkQueue(AnalysisUnit callee, VarContext<AntiDepAbsVal> beforeCall, DataFlowNodeIdentifier callSite)` Get the analysis results for the given callee and variable context.
    `protected FinalVarContext<AntiDepAbsVal>` | `guessAnalysisForMissingReceiver(polyglot.types.ProcedureInstance pi, VarContext<AntiDepAbsVal> input, AntiDepAbsVal receiverAbsVal, java.util.List<AntiDepAbsVal> argAbsVals, java.util.Set<ExitMap.Key> expectedExits, DataFlowNodeIdentifier callSiteNode)` Subclasses should override as a stop gap measure if the receiver is missing, i.e., if the points to set of the receiver expression is empty.
    `protected static java.util.List<java.lang.String>` | `List(java.lang.String s1)`
    `protected boolean` | `mayBeNull(AntiDepAbsVal exprDFI, polyglot.ast.Expr e, polyglot.visit.FlowGraph.Peer<VarContext<AntiDepAbsVal>> peer)`
    `protected boolean` | `mayThrowClassCastException(AntiDepAbsVal exprDFI, polyglot.ast.Cast cast, polyglot.visit.FlowGraph.Peer<VarContext<AntiDepAbsVal>> peer)`
    `protected java.util.Set<HContext>` | `pointsTo(AntiDepAbsVal exprDFI, polyglot.ast.Expr e)`

    - ### Methods inherited from class accrue.analysis.interprocvarcontext.AnalysisUtilVarContextDataFlow

      `call, call, call, callFromNew, constructorCall, constructorCallFromConstructor, getAnalysisResultsFromWorkQueue, guessAnalysisForMissingCode, makeFinalVarContext, mergeCallResults, prepareCalleeContext`

    - ### Methods inherited from class accrue.analysis.interprocvarcontext.AnalysisUtilVarContext

      `addLocations, analysisName, computeExpectedExits, createFinalVarContext, emptyFinalVarContext, getAnalysisForMissingReceiver, getLocationAbsVal, getSignatureForMissingCode, guessAnalysisForMissingCode, handleRecursiveCall, preCallNonVirtual, recordRead, recordReads, recordWrite, recordWrites, signatureAnalysisNames`

    - ### Methods inherited from class accrue.analysis.interprocanalysis.AnalysisUtil

      `abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocationsForArray, abstractLocationsForArray, abstractLocationsForArray, abstractLocationsImplicitTarget, analyzeInitializers, analyzeStaticInitializers, createExitMap, currentAnalysisUnit, currentClass, currentContext, extensionInfo, instanceInitializers, leq, maybeRecursiveCall, pointsTo, pointsTo, pointsTo, pointsTo, pointsTo, pointsTo, pointsTo, pointsTo, pointsTo, pointsToGraph, pointsToThis, process, recordMissingCode, typeSystem, upperBound, workQueue`

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

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

- - ### Field Detail

    - #### ts

          protected polyglot.types.TypeSystem ts

  - ### Constructor Detail

    - #### AntiDepAnalysisUtil

          public AntiDepAnalysisUtil(WorkQueue<VarContext<AntiDepAbsVal>> wq,
                             AnalysisUnit currentAnalysisUnit,
                             AccrueExtensionInfo extInfo)

  - ### Method Detail

    - #### analyze

          public FinalVarContext<AntiDepAbsVal> analyze(polyglot.ast.CodeNode n,
                                               VarContext<AntiDepAbsVal> input)
                                                 throws polyglot.types.SemanticException

      Description copied from class: `AnalysisUtil`
      Analyze the given code with the given current analysis results
      Specified by:
        `analyze` in class `AnalysisUtil<VarContext<AntiDepAbsVal>>`
      Parameters:
        `n` - Code to analyze
        `input` - analysis result before analyzing the given code
      Returns:
        Map from exit condition to analysis result
      Throws:
        `polyglot.types.SemanticException` - thrown if the analysis fails

    - #### createInitContext

          public VarContext<AntiDepAbsVal> createInitContext()

      Description copied from class: `AnalysisUtilVarContext`
      Create an initial variable context
      Overrides:
        `createInitContext` in class `AnalysisUtilVarContext<VarContext<AntiDepAbsVal>,AntiDepAbsVal>`
      Returns:
        initial variable context

    - #### callNonVirtual

          public FinalVarContext<AntiDepAbsVal> callNonVirtual(polyglot.types.ProcedureInstance pi,
                                                      AnalysisContext calleeContext,
                                                      HContext receiver,
                                                      AntiDepAbsVal receiverAbsVal,
                                                      VarContext<AntiDepAbsVal> input,
                                                      DataFlowNodeIdentifier callSite,
                                                      boolean canTerminateNormally)
                                                        throws polyglot.types.SemanticException

      Description copied from class: `AnalysisUtilVarContextDataFlow`
      Process a call to a non-virtual call to `pi` with `VarContext` `input`.
      Overrides:
        `callNonVirtual` in class `AnalysisUtilVarContextDataFlow<VarContext<AntiDepAbsVal>,AntiDepAbsVal>`
      Parameters:
        `pi` - call to analyze
        `calleeContext` - procedure analysis context
        `receiver` - abstract heap object for the callee
        `input` - variable context before analyzing the method
        `callSite` - the call site for the procedure call
        `canTerminateNormally` - true if the called procedure can terminate normally
      Returns:
        new map of variables to their values after the analysis
      Throws:
        `polyglot.types.SemanticException` - if analysis fails

    - #### mayBeNull

          protected boolean mayBeNull(AntiDepAbsVal exprDFI,
                          polyglot.ast.Expr e,
                          polyglot.visit.FlowGraph.Peer<VarContext<AntiDepAbsVal>> peer)

    - #### mayThrowClassCastException

          protected boolean mayThrowClassCastException(AntiDepAbsVal exprDFI,
                                           polyglot.ast.Cast cast,
                                           polyglot.visit.FlowGraph.Peer<VarContext<AntiDepAbsVal>> peer)

    - #### abstractLocations

          protected java.util.Set<AbstractLocation> abstractLocations(AntiDepAbsVal targetDFI,
                                                          polyglot.ast.Field f)

    - #### abstractLocations

          protected java.util.Set<AbstractLocation> abstractLocations(AntiDepAbsVal arrayDFI,
                                                          polyglot.ast.ArrayAccess aa)

    - #### pointsTo

          protected java.util.Set<HContext> pointsTo(AntiDepAbsVal exprDFI,
                                         polyglot.ast.Expr e)

    - #### analyzeInitializersForDataFlow

          public FinalVarContext<AntiDepAbsVal> analyzeInitializersForDataFlow(VarContext<AntiDepAbsVal> before)
                                                                        throws polyglot.types.SemanticException

      Description copied from class: `AnalysisUtilVarContextDataFlow`
      Analyze the initializers for the current analysis unit given the current analysis results
      Specified by:
        `analyzeInitializersForDataFlow` in class `AnalysisUtilVarContextDataFlow<VarContext<AntiDepAbsVal>,AntiDepAbsVal>`
      Returns:
        Map from exit condition to analysis result
      Throws:
        `polyglot.types.SemanticException` - thrown if the analysis fails

    - #### getAnalysisResultsFromWorkQueue

          protected FinalVarContext<AntiDepAbsVal> getAnalysisResultsFromWorkQueue(AnalysisUnit callee,
                                                                       VarContext<AntiDepAbsVal> beforeCall,
                                                                       DataFlowNodeIdentifier callSite)
                                                                            throws polyglot.types.SemanticException

      Description copied from class: `AnalysisUtilVarContextDataFlow`
      Get the analysis results for the given callee and variable context.
      Specified by:
        `getAnalysisResultsFromWorkQueue` in class `AnalysisUtilVarContextDataFlow<VarContext<AntiDepAbsVal>,AntiDepAbsVal>`
      Parameters:
        `callee` - Code for a callee that is to be analyzed
        `beforeCall` - variable context before the call to the callee
      Returns:
        new variable context after performing the analysis
      Throws:
        `polyglot.types.SemanticException` - thrown for an analysis error

    - #### bottomAbstractValue

          public AntiDepAbsVal bottomAbstractValue()

      Specified by:
        `bottomAbstractValue` in class `AnalysisUtilVarContext<VarContext<AntiDepAbsVal>,AntiDepAbsVal>`
      Returns:
        The bottom value in the abstract value lattice

    - #### guessAnalysisForMissingReceiver

          protected FinalVarContext<AntiDepAbsVal> guessAnalysisForMissingReceiver(polyglot.types.ProcedureInstance pi,
                                                                       VarContext<AntiDepAbsVal> input,
                                                                       AntiDepAbsVal receiverAbsVal,
                                                                       java.util.List<AntiDepAbsVal> argAbsVals,
                                                                       java.util.Set<ExitMap.Key> expectedExits,
                                                                       DataFlowNodeIdentifier callSiteNode)

      Description copied from class: `AnalysisUtilVarContext`
      Subclasses should override as a stop gap measure if the receiver is missing, i.e., if the points to set of the receiver expression is empty.
      Specified by:
        `guessAnalysisForMissingReceiver` in class `AnalysisUtilVarContext<VarContext<AntiDepAbsVal>,AntiDepAbsVal>`
      Parameters:
        `pi` - missing procedure
        `input` - variable context before analysis
        `receiverAbsVal` - abstract value for the receiver
        `argAbsVals` - list of abstract values for the procedure arguments
        `expectedExits` - set of expected exit keys
      Returns:
        New variable context updated from the input during analysis

    - #### List

          protected static java.util.List<java.lang.String> List(java.lang.String s1)