public class StmtRegistrar
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
StmtRegistrar.CodeInfo |
static class |
StmtRegistrar.ExceptionHandlerReferenceVariable |
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 and Description |
---|
StmtRegistrar(polyglot.frontend.ExtensionInfo extInfo) |
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) |
protected static java.util.Map<polyglot.frontend.ExtensionInfo,java.util.Map<polyglot.types.ClassType,ReferenceVariable>> generatedExceptionNodes
protected static final boolean USE_SINGLE_ALLOC_NODE_FOR_GENERATED_EXCEPTIONS
public static java.lang.String ARRAY_CONTENTS
public java.util.Collection<PointsToStmt> stmts()
public java.util.Collection<PointsToStmt> stmtsForCode(polyglot.types.CodeInstance ci)
public java.util.Collection<polyglot.util.ErrorInfo> missingCode()
public ReferenceVariable registerLocalDecl(polyglot.types.LocalInstance li, StmtRegistrar.CodeInfo containingCode, ConstructorContext constructorContext)
public boolean hasReferenceVariable(polyglot.types.LocalInstance li, StmtRegistrar.CodeInfo containingCode, ConstructorContext constructorContext)
public polyglot.ast.Local updateReferenceVariable(polyglot.ast.Local e, StmtRegistrar.CodeInfo containingCode, ConstructorContext constructorContext)
public polyglot.ast.Expr createFreshReferenceVariable(polyglot.ast.Expr e, ConstructorContext constructorContext)
public polyglot.ast.Expr createFreshReferenceVariable(polyglot.ast.Expr e, java.lang.String debugString, ConstructorContext constructorContext)
public void registerArrayClone(polyglot.ast.Call c, StmtRegistrar.CodeInfo codeInfo, ConstructorContext constructorContext)
public void registerAlloc(ExtExpr ext, polyglot.types.Type allocatedType, StmtRegistrar.CodeInfo codeInfo, ConstructorContext constructorContext)
public void registerAlloc(ExtExpr ext, polyglot.types.Type allocatedType, java.lang.String debugString, StmtRegistrar.CodeInfo codeInfo, ConstructorContext constructorContext)
public void registerStringLiteral(polyglot.ast.Expr e, StmtRegistrar.CodeInfo codeInfo, ConstructorContext constructorContext)
public void registerClassLiteral(polyglot.ast.ClassLit lit, StmtRegistrar.CodeInfo codeInfo, ConstructorContext constructorContext)
public ReferenceVariable registerAlloc(polyglot.types.ReferenceType type, polyglot.util.Position origin, java.lang.String debugString, StmtRegistrar.CodeInfo codeInfo)
public ReferenceVariable registerStaticAlloc(polyglot.types.Type type, boolean isPreciseType, java.lang.String debugString, polyglot.util.Position pos)
public void addAssignment(ReferenceVariable left, ReferenceVariable right, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)
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)
public void addAssignment(ReferenceVariable left, ReferenceVariable right, polyglot.types.FieldInstance fi, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)
public void addAssignment(ReferenceVariable left, ReferenceVariable right, java.lang.String field, polyglot.types.Type expectedFieldType, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)
public void addAssignmentToField(ReferenceVariable left, polyglot.types.FieldInstance fi, ReferenceVariable right, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)
public void addAssignmentToField(ReferenceVariable left, java.lang.String fi, polyglot.types.Type expectedFieldType, ReferenceVariable right, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)
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)
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)
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)
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)
public void addCatchImplicitError(ReferenceVariable catchFormal, polyglot.util.Position origin, StmtRegistrar.CodeInfo codeInfo)
protected void addStmt(PointsToStmt s)
public StmtRegistrar.CodeInfo recordProcedureDecl(polyglot.ast.ProcedureDecl pd, ConstructorContext constructorContext)
public void recordInitializer(polyglot.ast.Initializer init)
public void recordFieldDecl(polyglot.ast.FieldDecl fd)
protected void recordInitializerOrFieldDecl(polyglot.ast.CodeNode cn)
public StmtRegistrar.CodeInfo getCodeInfo(polyglot.types.ProcedureInstance pi)
public StmtRegistrar.CodeInfo getCodeInfo(polyglot.ast.Initializer staticInit)
public StmtRegistrar.CodeInfo getCodeInfo(polyglot.ast.FieldDecl staticInit)
public StmtRegistrar.CodeInfo getCodeInfo(polyglot.ast.CodeNode n)
public java.util.Set<polyglot.ast.ProcedureDecl> getStartProcs()
public java.util.Set<polyglot.ast.CodeNode> getStaticInitializers()
public java.util.List<polyglot.ast.CodeNode> getInstanceInitializers(polyglot.types.ClassType container)
public ReferenceVariable getLocalNode(polyglot.types.LocalInstance li, StmtRegistrar.CodeInfo containingCode, ConstructorContext constructorContext)
public ReferenceVariable nodeForStaticField(polyglot.types.FieldInstance fi)
protected ReferenceVariable freshReferenceVariable(java.lang.String debugString, boolean isSingleton, polyglot.types.Type expectedType, polyglot.util.Position pos)
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)
public void recordMissingCode(polyglot.types.ProcedureInstance pi, polyglot.util.Position pos)
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)
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)
public void addGeneratedExceptionAssignments(java.util.Set<polyglot.types.ClassType> exceptionTypes, polyglot.ast.Term cause, RegisterPointerStmtsVisitor v)
public void addExceptionAssignments(polyglot.types.Type exceptionType, ReferenceVariable exceptionLocalNode, polyglot.util.Position origin, RegisterPointerStmtsVisitor v)
public java.util.Collection<polyglot.types.CodeInstance> getInitialCodeInstances()