public class SubstitutionVisitor extends FixedPointAstMapVisitor
Modifier and Type | Field and Description |
---|---|
DynamicRegion |
dynRegion |
private ExprVisitorAdapter<za.ac.sun.cs.green.expr.Expression> |
eva |
private java.util.ArrayList<com.ibm.wala.types.MethodReference> |
invocationStack |
private static java.util.Set<com.ibm.wala.types.MethodReference> |
noFurtherInlines |
private Pair<com.ibm.wala.types.MethodReference,java.lang.Integer> |
recursiveScope |
private boolean |
spfCasePath
This is used to identify if a path had spfCase instruction that requires prouning the path.
|
gov.nasa.jpf.vm.ThreadInfo |
ti |
private boolean |
useVarTable |
firstException, instantiatedRegion, somethingChanged
exprVisitor
Modifier | Constructor and Description |
---|---|
private |
SubstitutionVisitor(gov.nasa.jpf.vm.ThreadInfo ti,
DynamicRegion dynRegion,
DynamicTable valueSymbolTable,
boolean useVarTable,
java.util.ArrayList<com.ibm.wala.types.MethodReference> invocationStack) |
Modifier and Type | Method and Description |
---|---|
private Pair<Stmt,DynamicTable> |
attemptHighOrderRegion(DynamicRegion methodRegion,
DynamicTable hgOrdValueSymbolTable)
Attempts to substitute in a high order region.
|
private java.lang.String |
convertToJavaName(java.lang.String currClassName) |
static SubstitutionVisitor |
create(gov.nasa.jpf.vm.ThreadInfo ti,
DynamicRegion dynRegion,
int iterationNumber,
boolean useVarTable) |
DynamicRegion |
execute()
Executes substitution over a non-method region.
|
private static DynamicTable |
fillValueSymbolTable(gov.nasa.jpf.vm.ThreadInfo ti,
DynamicRegion dynRegion)
Fills out the values of all vars that could be discovered in the region.
|
private Pair<java.lang.String,StaticRegion> |
findMethodRegion(gov.nasa.jpf.vm.ThreadInfo ti,
InvokeInstruction c)
Attempts to find a mapping MethodRegion.
|
boolean |
getChange() |
private Pair<Stmt,za.ac.sun.cs.green.expr.Expression> |
getStmtRetExp(Stmt stmt)
Iterates over the Stmt to get the return statement seperated out of the reset of the statements.
|
DynamicTable |
getValueSymbolTable() |
private boolean |
isAllowedRecursiveCall(com.ibm.wala.types.MethodReference calledTarget) |
private boolean |
isRecursiveCall(com.ibm.wala.types.MethodReference calledTarget) |
private Pair<java.lang.String,StaticRegion> |
jitFindMethodRegion(gov.nasa.jpf.vm.ThreadInfo ti,
InvokeInstruction c)
Attempts to find a mapping MethodRegion.
|
void |
setSomethingChanged(boolean change) |
void |
setValueSymbolTable(DynamicTable valueSymbolTable) |
Stmt |
visit(ArrayLengthInstruction c) |
Stmt |
visit(ArrayLoadInstruction c) |
Stmt |
visit(ArrayStoreInstruction c) |
Stmt |
visit(AssignmentStmt a) |
Stmt |
visit(GetInstruction c) |
Stmt |
visit(IfThenElseStmt c)
While visiting IfThenElse, it is responsible for resetting the spfCasePath, if on one path of its branches an SPFCase instruction was discoverd, such as throw or object creation, if this happens then along that path, there should be no high order regions inlined.
|
Stmt |
visit(InvokeInstruction c)
Visits an InvokeInstruction by attempting to inline static method regions.
|
Stmt |
visit(NewInstruction c) |
Stmt |
visit(PhiInstruction c) |
Stmt |
visit(ReturnInstruction c) |
Stmt |
visit(ThrowInstruction c) |
getFirstException
visit, visit, visit, visit, visit, visit, visit
private final java.util.ArrayList<com.ibm.wala.types.MethodReference> invocationStack
private ExprVisitorAdapter<za.ac.sun.cs.green.expr.Expression> eva
public final DynamicRegion dynRegion
public final gov.nasa.jpf.vm.ThreadInfo ti
private boolean useVarTable
private Pair<com.ibm.wala.types.MethodReference,java.lang.Integer> recursiveScope
private static java.util.Set<com.ibm.wala.types.MethodReference> noFurtherInlines
private boolean spfCasePath
private SubstitutionVisitor(gov.nasa.jpf.vm.ThreadInfo ti, DynamicRegion dynRegion, DynamicTable valueSymbolTable, boolean useVarTable, java.util.ArrayList<com.ibm.wala.types.MethodReference> invocationStack)
public void setSomethingChanged(boolean change)
public boolean getChange()
getChange
in class FixedPointAstMapVisitor
public void setValueSymbolTable(DynamicTable valueSymbolTable)
public DynamicTable getValueSymbolTable()
public Stmt visit(AssignmentStmt a)
visit
in interface AstVisitor<Stmt>
visit
in class AstMapVisitor
public Stmt visit(ArrayLoadInstruction c)
visit
in interface AstVisitor<Stmt>
visit
in class AstMapVisitor
public Stmt visit(ArrayStoreInstruction c)
visit
in interface AstVisitor<Stmt>
visit
in class AstMapVisitor
public Stmt visit(GetInstruction c)
visit
in interface AstVisitor<Stmt>
visit
in class AstMapVisitor
public Stmt visit(ArrayLengthInstruction c)
visit
in interface AstVisitor<Stmt>
visit
in class AstMapVisitor
public Stmt visit(NewInstruction c)
visit
in interface AstVisitor<Stmt>
visit
in class AstMapVisitor
public Stmt visit(ThrowInstruction c)
visit
in interface AstVisitor<Stmt>
visit
in class AstMapVisitor
public Stmt visit(IfThenElseStmt c)
visit
in interface AstVisitor<Stmt>
visit
in class AstMapVisitor
c
- public Stmt visit(ReturnInstruction c)
visit
in interface AstVisitor<Stmt>
visit
in class AstMapVisitor
public Stmt visit(PhiInstruction c)
visit
in interface AstVisitor<Stmt>
visit
in class AstMapVisitor
public Stmt visit(InvokeInstruction c)
visit
in interface AstVisitor<Stmt>
visit
in class AstMapVisitor
c
- Invoke Instruction to be visited.private boolean isRecursiveCall(com.ibm.wala.types.MethodReference calledTarget)
private boolean isAllowedRecursiveCall(com.ibm.wala.types.MethodReference calledTarget)
private Pair<Stmt,DynamicTable> attemptHighOrderRegion(DynamicRegion methodRegion, DynamicTable hgOrdValueSymbolTable) throws StaticRegionException
methodRegion
- MethodRegion where the substitution is going to be attempted.hgOrdValueSymbolTable
- Value symbol table for te MethodRegion, usually populated with the parameters.StaticRegionException
private Pair<Stmt,za.ac.sun.cs.green.expr.Expression> getStmtRetExp(Stmt stmt)
stmt
- A statement that ends with a return expression.private Pair<java.lang.String,StaticRegion> jitFindMethodRegion(gov.nasa.jpf.vm.ThreadInfo ti, InvokeInstruction c) throws StaticRegionException
c
- Current invoke instruction.StaticRegionException
private Pair<java.lang.String,StaticRegion> findMethodRegion(gov.nasa.jpf.vm.ThreadInfo ti, InvokeInstruction c)
c
- Current invoke instruction.private java.lang.String convertToJavaName(java.lang.String currClassName)
private static DynamicTable fillValueSymbolTable(gov.nasa.jpf.vm.ThreadInfo ti, DynamicRegion dynRegion) throws StaticRegionException
ti
- Current executing thread.dynRegion
- DynamicRegion for which the ValueSymbolTable is going to be created.StaticRegionException
public DynamicRegion execute()
execute
in class FixedPointAstMapVisitor
public static SubstitutionVisitor create(gov.nasa.jpf.vm.ThreadInfo ti, DynamicRegion dynRegion, int iterationNumber, boolean useVarTable)