public static class DemandPointerFlowGraph.StatementVisitor extends SSAInstruction.Visitor implements AbstractDemandFlowGraph.FlowStatementVisitor
strategy: when visiting a statement, for each use of that statement, add a graph edge from def to use.
TODO: special treatment for parameter passing, etc.
| Modifier and Type | Field and Description |
|---|---|
protected DefUse |
du
Def-use information
|
protected IR |
ir
The governing IR
|
protected CGNode |
node
The node whose statements we are currently traversing
|
protected SymbolTable |
symbolTable
Governing symbol table
|
| Constructor and Description |
|---|
StatementVisitor(HeapModel heapModel,
IFlowGraph g,
IClassHierarchy cha,
CallGraph cg,
CGNode node) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addExceptionDefConstraints(IR ir,
CGNode node,
java.util.List<ProgramCounter> peis,
PointerKey exceptionVar,
java.util.Set<IClass> catchClasses)
Generate constraints which assign exception values into an exception pointer
|
ISSABasicBlock |
getBasicBlock() |
void |
setBasicBlock(ISSABasicBlock block)
The calling loop must call this in each iteration!
|
void |
visitArrayLoad(SSAArrayLoadInstruction instruction) |
void |
visitArrayStore(SSAArrayStoreInstruction instruction) |
void |
visitCheckCast(SSACheckCastInstruction instruction) |
void |
visitGet(SSAGetInstruction instruction) |
void |
visitGetCaughtException(SSAGetCaughtExceptionInstruction instruction) |
protected void |
visitGetInternal(int lval,
int ref,
boolean isStatic,
FieldReference field) |
void |
visitInvoke(SSAInvokeInstruction instruction) |
void |
visitLoadMetadata(SSALoadMetadataInstruction instruction) |
void |
visitNew(SSANewInstruction instruction) |
void |
visitPi(SSAPiInstruction instruction) |
void |
visitPut(SSAPutInstruction instruction) |
void |
visitPutInternal(int rval,
int ref,
boolean isStatic,
FieldReference field) |
void |
visitReturn(SSAReturnInstruction instruction) |
void |
visitThrow(SSAThrowInstruction instruction) |
visitArrayLength, visitBinaryOp, visitComparison, visitConditionalBranch, visitConversion, visitGoto, visitInstanceof, visitMonitor, visitPhi, visitSwitch, visitUnaryOpclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvisitArrayLength, visitBinaryOp, visitComparison, visitConditionalBranch, visitConversion, visitGoto, visitInstanceof, visitMonitor, visitPhi, visitSwitch, visitUnaryOpprotected final CGNode node
protected final IR ir
protected final SymbolTable symbolTable
protected final DefUse du
public StatementVisitor(HeapModel heapModel, IFlowGraph g, IClassHierarchy cha, CallGraph cg, CGNode node)
public void visitArrayLoad(SSAArrayLoadInstruction instruction)
visitArrayLoad in interface SSAInstruction.IVisitorvisitArrayLoad in class SSAInstruction.Visitorpublic void visitArrayStore(SSAArrayStoreInstruction instruction)
visitArrayStore in interface SSAInstruction.IVisitorvisitArrayStore in class SSAInstruction.Visitorpublic void visitCheckCast(SSACheckCastInstruction instruction)
visitCheckCast in interface SSAInstruction.IVisitorvisitCheckCast in class SSAInstruction.Visitorpublic void visitReturn(SSAReturnInstruction instruction)
visitReturn in interface SSAInstruction.IVisitorvisitReturn in class SSAInstruction.Visitorpublic void visitGet(SSAGetInstruction instruction)
visitGet in interface SSAInstruction.IVisitorvisitGet in class SSAInstruction.Visitorprotected void visitGetInternal(int lval,
int ref,
boolean isStatic,
FieldReference field)
public void visitPut(SSAPutInstruction instruction)
visitPut in interface SSAInstruction.IVisitorvisitPut in class SSAInstruction.Visitorpublic void visitPutInternal(int rval,
int ref,
boolean isStatic,
FieldReference field)
public void visitInvoke(SSAInvokeInstruction instruction)
visitInvoke in interface SSAInstruction.IVisitorvisitInvoke in class SSAInstruction.Visitorpublic void visitNew(SSANewInstruction instruction)
visitNew in interface SSAInstruction.IVisitorvisitNew in class SSAInstruction.Visitorpublic void visitThrow(SSAThrowInstruction instruction)
visitThrow in interface SSAInstruction.IVisitorvisitThrow in class SSAInstruction.Visitorpublic void visitGetCaughtException(SSAGetCaughtExceptionInstruction instruction)
visitGetCaughtException in interface SSAInstruction.IVisitorvisitGetCaughtException in class SSAInstruction.Visitorprotected void addExceptionDefConstraints(IR ir, CGNode node, java.util.List<ProgramCounter> peis, PointerKey exceptionVar, java.util.Set<IClass> catchClasses)
node - governing nodepeis - list of PEI instructionsexceptionVar - PointerKey representing a pointer to an exception valuecatchClasses - the types "caught" by the exceptionVarpublic void visitPi(SSAPiInstruction instruction)
visitPi in interface SSAInstruction.IVisitorvisitPi in class SSAInstruction.Visitorpublic ISSABasicBlock getBasicBlock()
public void setBasicBlock(ISSABasicBlock block)
setBasicBlock in interface AbstractDemandFlowGraph.FlowStatementVisitorpublic void visitLoadMetadata(SSALoadMetadataInstruction instruction)
visitLoadMetadata in interface SSAInstruction.IVisitorvisitLoadMetadata in class SSAInstruction.Visitor