accrue.analysis.pointer

## Class StmtRegistrar

- java.lang.Object
- - accrue.analysis.pointer.StmtRegistrar

- Direct Known Subclasses:
    JL5StmtRegistrar

      public class StmtRegistrar
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `StmtRegistrar.CodeInfo`
    `static class` | `StmtRegistrar.ExceptionHandlerReferenceVariable`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ARRAY_CONTENTS`
    `protected static java.util.Map<polyglot.frontend.ExtensionInfo,java.util.Map<polyglot.types.ClassType,ReferenceVariable>>` | `generatedExceptionNodes`
    `protected static boolean` | `USE_SINGLE_ALLOC_NODE_FOR_GENERATED_EXCEPTIONS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StmtRegistrar(polyglot.frontend.ExtensionInfo extInfo)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAssignment(ReferenceVariable left, ReferenceVariable right, polyglot.types.FieldInstance fi, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)` left = right.fi
    `void` | `addAssignment(ReferenceVariable left, ReferenceVariable right, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)` left = right
    `void` | `addAssignment(ReferenceVariable left, ReferenceVariable right, java.lang.String field, polyglot.types.Type expectedFieldType, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)` left = right.fi
    `void` | `addAssignmentToField(ReferenceVariable left, polyglot.types.FieldInstance fi, ReferenceVariable right, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)` left.fi = right
    `void` | `addAssignmentToField(ReferenceVariable left, java.lang.String fi, polyglot.types.Type expectedFieldType, ReferenceVariable right, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)` left.fi = right
    `void` | `addCatchImplicitError(ReferenceVariable catchFormal, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)` catch (T e) { ...
    `void` | `addConstructorCall(ReferenceVariable receiver, polyglot.types.ConstructorInstance ci, ExtProcedureCall ext, java.util.List<ReferenceVariable> actuals, java.util.List<StmtRegistrar.ExceptionHandlerReferenceVariable> exceptionHandlers, java.util.Map<polyglot.types.Type,ReferenceVariable> procedureThrows, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)`
    `void` | `addExceptionAssignments(polyglot.types.Type exceptionType, ReferenceVariable exceptionLocalNode, polyglot.util.Position origin, RegisterPointerStmtsVisitor v)` Utility method for adding exceptions
    `void` | `addFilteredAssignment(ReferenceVariable left, ReferenceVariable right, polyglot.types.Type t, java.util.Set<polyglot.types.Type> notT, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)` left = right, and only allow left to point to objects that are subtypes of t and not subtypes of any element of notT.
    `void` | `addGeneratedExceptionAssignments(java.util.Set<polyglot.types.ClassType> exceptionTypes, polyglot.ast.Term cause, RegisterPointerStmtsVisitor v)` Utility method for adding exceptions
    `void` | `addSpecialCall(ReferenceVariable result, ReferenceVariable receiver, polyglot.types.MethodInstance mi, ExtProcedureCall ext, java.util.List<ReferenceVariable> actuals, java.util.List<StmtRegistrar.ExceptionHandlerReferenceVariable> exceptionHandlers, java.util.Map<polyglot.types.Type,ReferenceVariable> procedureThrows, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)`
    `void` | `addStaticCall(ReferenceVariable result, polyglot.types.MethodInstance mi, ExtProcedureCall ext, java.util.List<ReferenceVariable> actuals, java.util.List<StmtRegistrar.ExceptionHandlerReferenceVariable> exceptionHandlers, java.util.Map<polyglot.types.Type,ReferenceVariable> procedureThrows, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)`
    `protected void` | `addStmt(PointsToStmt s)`
    `void` | `addVirtualCall(ReferenceVariable result, ReferenceVariable receiver, polyglot.types.MethodInstance pi, ExtProcedureCall ext, java.util.List<ReferenceVariable> actuals, java.util.List<StmtRegistrar.ExceptionHandlerReferenceVariable> exceptionHandlers, java.util.Map<polyglot.types.Type,ReferenceVariable> procedureThrows, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)`
    `polyglot.ast.Expr` | `createFreshReferenceVariable(polyglot.ast.Expr e, ConstructorContext constructorContext)`
    `polyglot.ast.Expr` | `createFreshReferenceVariable(polyglot.ast.Expr e, java.lang.String debugString, ConstructorContext constructorContext)`
    `protected AllocSiteNode` | `freshAllocNode(polyglot.types.Type type, polyglot.types.ClassType containingClass, boolean isPreciseType, java.lang.String debugString, polyglot.util.Position pos)`
    `protected CallSiteNode` | `freshCallSiteNode(polyglot.types.ProcedureInstance callee, java.lang.String debugString, polyglot.util.Position pos)`
    `protected ReferenceVariable` | `freshReferenceVariable(java.lang.String debugString, boolean isSingleton, polyglot.types.Type expectedType, polyglot.util.Position pos)`
    `StmtRegistrar.CodeInfo` | `getCodeInfo(polyglot.ast.CodeNode n)`
    `StmtRegistrar.CodeInfo` | `getCodeInfo(polyglot.ast.FieldDecl staticInit)`
    `StmtRegistrar.CodeInfo` | `getCodeInfo(polyglot.ast.Initializer staticInit)`
    `StmtRegistrar.CodeInfo` | `getCodeInfo(polyglot.types.ProcedureInstance pi)`
    `java.util.Collection<polyglot.types.CodeInstance>` | `getInitialCodeInstances()` Return the code instances that should be analyzed in the initial context.
    `java.util.List<polyglot.ast.CodeNode>` | `getInstanceInitializers(polyglot.types.ClassType container)`
    `ReferenceVariable` | `getLocalNode(polyglot.types.LocalInstance li, StmtRegistrar.CodeInfo containingCode, ConstructorContext constructorContext)`
    `java.util.Set<polyglot.ast.ProcedureDecl>` | `getStartProcs()`
    `java.util.Set<polyglot.ast.CodeNode>` | `getStaticInitializers()`
    `boolean` | `hasReferenceVariable(polyglot.types.LocalInstance li, StmtRegistrar.CodeInfo containingCode, ConstructorContext constructorContext)`
    `java.util.Collection<polyglot.util.ErrorInfo>` | `missingCode()`
    `ReferenceVariable` | `nodeForStaticField(polyglot.types.FieldInstance fi)`
    `boolean` | `processMissingCode(polyglot.types.CodeInstance caller, CContext callerContext, CallSiteNode callSiteNode, polyglot.types.ConstructorInstance ci, ReferenceVariableReplica newAllocatedObject, java.util.List<ReferenceVariableReplica> args, java.util.List<StmtProcedureCall.ExceptionHandlerPointsToGraphNode> handlers, java.util.Map<polyglot.types.Type,ReferenceVariableReplica> procThrows, PointsToGraph g, polyglot.util.Position origin, HeapAbstractionFactory af, PointsToEngine.StmtAndContext sac)`
    `boolean` | `processMissingCode(polyglot.types.CodeInstance caller, CContext callerContext, CallSiteNode callSiteNode, polyglot.types.MethodInstance mi, java.util.List<ReferenceVariableReplica> args, HContext receiver, ReferenceVariableReplica result, java.util.List<StmtProcedureCall.ExceptionHandlerPointsToGraphNode> handlers, java.util.Map<polyglot.types.Type,ReferenceVariableReplica> procThrows, PointsToGraph g, polyglot.util.Position origin, HeapAbstractionFactory af, PointsToEngine.StmtAndContext sac)`
    `void` | `recordFieldDecl(polyglot.ast.FieldDecl fd)` Record the existence of a field decl
    `void` | `recordInitializer(polyglot.ast.Initializer init)` Record the existence of an initializer
    `protected void` | `recordInitializerOrFieldDecl(polyglot.ast.CodeNode cn)` Internal method that factors out the common functionality for recording the existence of an initializer or field decl
    `void` | `recordMissingCode(polyglot.types.ProcedureInstance pi, polyglot.util.Position pos)`
    `StmtRegistrar.CodeInfo` | `recordProcedureDecl(polyglot.ast.ProcedureDecl pd, ConstructorContext constructorContext)` Record the existence of a procedure decl.
    `void` | `registerAlloc(ExtExpr ext, polyglot.types.Type allocatedType, StmtRegistrar.CodeInfo codeInfo, ConstructorContext constructorContext)`
    `void` | `registerAlloc(ExtExpr ext, polyglot.types.Type allocatedType, java.lang.String debugString, StmtRegistrar.CodeInfo codeInfo, ConstructorContext constructorContext)`
    `ReferenceVariable` | `registerAlloc(polyglot.types.ReferenceType type, polyglot.util.Position origin, java.lang.String debugString, StmtRegistrar.CodeInfo codeInfo)`
    `void` | `registerArrayClone(polyglot.ast.Call c, StmtRegistrar.CodeInfo codeInfo, ConstructorContext constructorContext)`
    `void` | `registerClassLiteral(polyglot.ast.ClassLit lit, StmtRegistrar.CodeInfo codeInfo, ConstructorContext constructorContext)`
    `ReferenceVariable` | `registerLocalDecl(polyglot.types.LocalInstance li, StmtRegistrar.CodeInfo containingCode, ConstructorContext constructorContext)`
    `ReferenceVariable` | `registerStaticAlloc(polyglot.types.Type type, boolean isPreciseType, java.lang.String debugString, polyglot.util.Position pos)`
    `void` | `registerStringLiteral(polyglot.ast.Expr e, StmtRegistrar.CodeInfo codeInfo, ConstructorContext constructorContext)`
    `java.util.Collection<PointsToStmt>` | `stmts()`
    `java.util.Collection<PointsToStmt>` | `stmtsForCode(polyglot.types.CodeInstance ci)`
    `polyglot.ast.Local` | `updateReferenceVariable(polyglot.ast.Local e, StmtRegistrar.CodeInfo containingCode, ConstructorContext constructorContext)`

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

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

- - ### Field Detail

    - #### generatedExceptionNodes

          protected static java.util.Map<polyglot.frontend.ExtensionInfo,java.util.Map<polyglot.types.ClassType,ReferenceVariable>> generatedExceptionNodes

    - #### USE_SINGLE_ALLOC_NODE_FOR_GENERATED_EXCEPTIONS

          protected static final boolean USE_SINGLE_ALLOC_NODE_FOR_GENERATED_EXCEPTIONS

      See Also:
        Constant Field Values

    - #### ARRAY_CONTENTS

          public static java.lang.String ARRAY_CONTENTS

  - ### Constructor Detail

    - #### StmtRegistrar

          public StmtRegistrar(polyglot.frontend.ExtensionInfo extInfo)

  - ### Method Detail

    - #### stmts

          public java.util.Collection<PointsToStmt> stmts()

    - #### stmtsForCode

          public java.util.Collection<PointsToStmt> stmtsForCode(polyglot.types.CodeInstance ci)

    - #### missingCode

          public java.util.Collection<polyglot.util.ErrorInfo> missingCode()

    - #### registerLocalDecl

          public ReferenceVariable registerLocalDecl(polyglot.types.LocalInstance li,
                                            StmtRegistrar.CodeInfo containingCode,
                                            ConstructorContext constructorContext)

    - #### hasReferenceVariable

          public boolean hasReferenceVariable(polyglot.types.LocalInstance li,
                                     StmtRegistrar.CodeInfo containingCode,
                                     ConstructorContext constructorContext)

    - #### updateReferenceVariable

          public polyglot.ast.Local updateReferenceVariable(polyglot.ast.Local e,
                                                   StmtRegistrar.CodeInfo containingCode,
                                                   ConstructorContext constructorContext)

    - #### createFreshReferenceVariable

          public polyglot.ast.Expr createFreshReferenceVariable(polyglot.ast.Expr e,
                                                       ConstructorContext constructorContext)

    - #### createFreshReferenceVariable

          public polyglot.ast.Expr createFreshReferenceVariable(polyglot.ast.Expr e,
                                                       java.lang.String debugString,
                                                       ConstructorContext constructorContext)

    - #### registerArrayClone

          public void registerArrayClone(polyglot.ast.Call c,
                                StmtRegistrar.CodeInfo codeInfo,
                                ConstructorContext constructorContext)

    - #### registerAlloc

          public void registerAlloc(ExtExpr ext,
                           polyglot.types.Type allocatedType,
                           StmtRegistrar.CodeInfo codeInfo,
                           ConstructorContext constructorContext)

    - #### registerAlloc

          public void registerAlloc(ExtExpr ext,
                           polyglot.types.Type allocatedType,
                           java.lang.String debugString,
                           StmtRegistrar.CodeInfo codeInfo,
                           ConstructorContext constructorContext)

    - #### registerStringLiteral

          public void registerStringLiteral(polyglot.ast.Expr e,
                                   StmtRegistrar.CodeInfo codeInfo,
                                   ConstructorContext constructorContext)

    - #### registerClassLiteral

          public void registerClassLiteral(polyglot.ast.ClassLit lit,
                                  StmtRegistrar.CodeInfo codeInfo,
                                  ConstructorContext constructorContext)

    - #### registerAlloc

          public ReferenceVariable registerAlloc(polyglot.types.ReferenceType type,
                                        polyglot.util.Position origin,
                                        java.lang.String debugString,
                                        StmtRegistrar.CodeInfo codeInfo)

    - #### registerStaticAlloc

          public ReferenceVariable registerStaticAlloc(polyglot.types.Type type,
                                              boolean isPreciseType,
                                              java.lang.String debugString,
                                              polyglot.util.Position pos)

    - #### addAssignment

          public void addAssignment(ReferenceVariable left,
                           ReferenceVariable right,
                           polyglot.util.Position origin,
                           StmtRegistrar.CodeInfo codeInfo)

      left = right

    - #### addFilteredAssignment

          public void addFilteredAssignment(ReferenceVariable left,
                                   ReferenceVariable right,
                                   polyglot.types.Type t,
                                   java.util.Set<polyglot.types.Type> notT,
                                   polyglot.util.Position origin,
                                   StmtRegistrar.CodeInfo codeInfo)

      left = right, and only allow left to point to objects that are subtypes of t and not subtypes of any element of notT.

    - #### addAssignment

          public void addAssignment(ReferenceVariable left,
                           ReferenceVariable right,
                           polyglot.types.FieldInstance fi,
                           polyglot.util.Position origin,
                           StmtRegistrar.CodeInfo codeInfo)

      left = right.fi

    - #### addAssignment

          public void addAssignment(ReferenceVariable left,
                           ReferenceVariable right,
                           java.lang.String field,
                           polyglot.types.Type expectedFieldType,
                           polyglot.util.Position origin,
                           StmtRegistrar.CodeInfo codeInfo)

      left = right.fi

    - #### addAssignmentToField

          public void addAssignmentToField(ReferenceVariable left,
                                  polyglot.types.FieldInstance fi,
                                  ReferenceVariable right,
                                  polyglot.util.Position origin,
                                  StmtRegistrar.CodeInfo codeInfo)

      left.fi = right

    - #### addAssignmentToField

          public void addAssignmentToField(ReferenceVariable left,
                                  java.lang.String fi,
                                  polyglot.types.Type expectedFieldType,
                                  ReferenceVariable right,
                                  polyglot.util.Position origin,
                                  StmtRegistrar.CodeInfo codeInfo)

      left.fi = right

    - #### addStaticCall

          public void addStaticCall(ReferenceVariable result,
                           polyglot.types.MethodInstance mi,
                           ExtProcedureCall ext,
                           java.util.List<ReferenceVariable> actuals,
                           java.util.List<StmtRegistrar.ExceptionHandlerReferenceVariable> exceptionHandlers,
                           java.util.Map<polyglot.types.Type,ReferenceVariable> procedureThrows,
                           polyglot.util.Position origin,
                           StmtRegistrar.CodeInfo codeInfo)

    - #### addSpecialCall

          public void addSpecialCall(ReferenceVariable result,
                            ReferenceVariable receiver,
                            polyglot.types.MethodInstance mi,
                            ExtProcedureCall ext,
                            java.util.List<ReferenceVariable> actuals,
                            java.util.List<StmtRegistrar.ExceptionHandlerReferenceVariable> exceptionHandlers,
                            java.util.Map<polyglot.types.Type,ReferenceVariable> procedureThrows,
                            polyglot.util.Position origin,
                            StmtRegistrar.CodeInfo codeInfo)

    - #### addConstructorCall

          public void addConstructorCall(ReferenceVariable receiver,
                                polyglot.types.ConstructorInstance ci,
                                ExtProcedureCall ext,
                                java.util.List<ReferenceVariable> actuals,
                                java.util.List<StmtRegistrar.ExceptionHandlerReferenceVariable> exceptionHandlers,
                                java.util.Map<polyglot.types.Type,ReferenceVariable> procedureThrows,
                                polyglot.util.Position origin,
                                StmtRegistrar.CodeInfo codeInfo)

    - #### addVirtualCall

          public void addVirtualCall(ReferenceVariable result,
                            ReferenceVariable receiver,
                            polyglot.types.MethodInstance pi,
                            ExtProcedureCall ext,
                            java.util.List<ReferenceVariable> actuals,
                            java.util.List<StmtRegistrar.ExceptionHandlerReferenceVariable> exceptionHandlers,
                            java.util.Map<polyglot.types.Type,ReferenceVariable> procedureThrows,
                            polyglot.util.Position origin,
                            StmtRegistrar.CodeInfo codeInfo)

    - #### addCatchImplicitError

          public void addCatchImplicitError(ReferenceVariable catchFormal,
                                   polyglot.util.Position origin,
                                   StmtRegistrar.CodeInfo codeInfo)

      catch (T e) { ... } where T is either a subtype of Error, or a supertype of Error.

    - #### addStmt

          protected void addStmt(PointsToStmt s)

    - #### recordProcedureDecl

          public StmtRegistrar.CodeInfo recordProcedureDecl(polyglot.ast.ProcedureDecl pd,
                                                   ConstructorContext constructorContext)

      Record the existence of a procedure decl.

    - #### recordInitializer

          public void recordInitializer(polyglot.ast.Initializer init)

      Record the existence of an initializer

    - #### recordFieldDecl

          public void recordFieldDecl(polyglot.ast.FieldDecl fd)

      Record the existence of a field decl

    - #### recordInitializerOrFieldDecl

          protected void recordInitializerOrFieldDecl(polyglot.ast.CodeNode cn)

      Internal method that factors out the common functionality for recording the existence of an initializer or field decl

    - #### getCodeInfo

          public StmtRegistrar.CodeInfo getCodeInfo(polyglot.types.ProcedureInstance pi)

    - #### getCodeInfo

          public StmtRegistrar.CodeInfo getCodeInfo(polyglot.ast.Initializer staticInit)

    - #### getCodeInfo

          public StmtRegistrar.CodeInfo getCodeInfo(polyglot.ast.FieldDecl staticInit)

    - #### getCodeInfo

          public StmtRegistrar.CodeInfo getCodeInfo(polyglot.ast.CodeNode n)

    - #### getStartProcs

          public java.util.Set<polyglot.ast.ProcedureDecl> getStartProcs()

    - #### getStaticInitializers

          public java.util.Set<polyglot.ast.CodeNode> getStaticInitializers()

    - #### getInstanceInitializers

          public java.util.List<polyglot.ast.CodeNode> getInstanceInitializers(polyglot.types.ClassType container)

    - #### getLocalNode

          public ReferenceVariable getLocalNode(polyglot.types.LocalInstance li,
                                       StmtRegistrar.CodeInfo containingCode,
                                       ConstructorContext constructorContext)

    - #### nodeForStaticField

          public ReferenceVariable nodeForStaticField(polyglot.types.FieldInstance fi)

    - #### freshReferenceVariable

          protected ReferenceVariable freshReferenceVariable(java.lang.String debugString,
                                                 boolean isSingleton,
                                                 polyglot.types.Type expectedType,
                                                 polyglot.util.Position pos)

    - #### freshAllocNode

          protected AllocSiteNode freshAllocNode(polyglot.types.Type type,
                                     polyglot.types.ClassType containingClass,
                                     boolean isPreciseType,
                                     java.lang.String debugString,
                                     polyglot.util.Position pos)

    - #### freshCallSiteNode

          protected CallSiteNode freshCallSiteNode(polyglot.types.ProcedureInstance callee,
                                       java.lang.String debugString,
                                       polyglot.util.Position pos)

    - #### recordMissingCode

          public void recordMissingCode(polyglot.types.ProcedureInstance pi,
                               polyglot.util.Position pos)

    - #### processMissingCode

          public boolean processMissingCode(polyglot.types.CodeInstance caller,
                                   CContext callerContext,
                                   CallSiteNode callSiteNode,
                                   polyglot.types.MethodInstance mi,
                                   java.util.List<ReferenceVariableReplica> args,
                                   HContext receiver,
                                   ReferenceVariableReplica result,
                                   java.util.List<StmtProcedureCall.ExceptionHandlerPointsToGraphNode> handlers,
                                   java.util.Map<polyglot.types.Type,ReferenceVariableReplica> procThrows,
                                   PointsToGraph g,
                                   polyglot.util.Position origin,
                                   HeapAbstractionFactory af,
                                   PointsToEngine.StmtAndContext sac)

    - #### processMissingCode

          public boolean processMissingCode(polyglot.types.CodeInstance caller,
                                   CContext callerContext,
                                   CallSiteNode callSiteNode,
                                   polyglot.types.ConstructorInstance ci,
                                   ReferenceVariableReplica newAllocatedObject,
                                   java.util.List<ReferenceVariableReplica> args,
                                   java.util.List<StmtProcedureCall.ExceptionHandlerPointsToGraphNode> handlers,
                                   java.util.Map<polyglot.types.Type,ReferenceVariableReplica> procThrows,
                                   PointsToGraph g,
                                   polyglot.util.Position origin,
                                   HeapAbstractionFactory af,
                                   PointsToEngine.StmtAndContext sac)

    - #### addGeneratedExceptionAssignments

          public void addGeneratedExceptionAssignments(java.util.Set<polyglot.types.ClassType> exceptionTypes,
                                              polyglot.ast.Term cause,
                                              RegisterPointerStmtsVisitor v)

      Utility method for adding exceptions

    - #### addExceptionAssignments

          public void addExceptionAssignments(polyglot.types.Type exceptionType,
                                     ReferenceVariable exceptionLocalNode,
                                     polyglot.util.Position origin,
                                     RegisterPointerStmtsVisitor v)

      Utility method for adding exceptions

    - #### getInitialCodeInstances

          public java.util.Collection<polyglot.types.CodeInstance> getInitialCodeInstances()

      Return the code instances that should be analyzed in the initial context. This is typically the start prceodure(s), and static initializers.