public class InstanceOfPiPolicy extends java.lang.Object implements SSAPiNodePolicy
If we have the following code:
S1: c = v1 instanceof T S2: if (c == 0) { ... }
replace it with:
S1: c = v1 instanceof T S2: if (c == 0) { v2 = PI(v1, S1) .... }
The same pattern holds if the test is c == 1. This renaming allows SSA-based analysis to reason
about the type of v2 depending on the outcome of the branch.| Modifier and Type | Method and Description |
|---|---|
static InstanceOfPiPolicy |
createInstanceOfPiPolicy() |
boolean |
equals(java.lang.Object obj) |
com.ibm.wala.util.collections.Pair<java.lang.Integer,SSAInstruction> |
getPi(SSAAbstractInvokeInstruction call,
SymbolTable symbolTable)
Do we need to introduce a new name for some value immediately after a call?
|
com.ibm.wala.util.collections.Pair<java.lang.Integer,SSAInstruction> |
getPi(SSAConditionalBranchInstruction cond,
SSAInstruction def1,
SSAInstruction def2,
SymbolTable symbolTable)
Do we need to introduce a new name for some value after deciding on an outcome for a
conditional branch instruction?
|
java.util.List<com.ibm.wala.util.collections.Pair<java.lang.Integer,SSAInstruction>> |
getPis(SSAConditionalBranchInstruction cond,
SSAInstruction def1,
SSAInstruction def2,
SymbolTable symbolTable) |
int |
hashCode() |
public static InstanceOfPiPolicy createInstanceOfPiPolicy()
public com.ibm.wala.util.collections.Pair<java.lang.Integer,SSAInstruction> getPi(SSAConditionalBranchInstruction cond, SSAInstruction def1, SSAInstruction def2, SymbolTable symbolTable)
SSAPiNodePolicyIf so, returns a pair consisting of the value number needing renaming, and the instruction which should be recorded as the cause of the pi instruction
getPi in interface SSAPiNodePolicycond - the conditional branch instruction in questiondef1 - the SSAInstruction that defs cond.getUse(0), or null if nonedef2 - the SSAInstruction that defs cond.getUse(1), or null if nonesymbolTable - current state of the symbol table for the IR under constructionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic com.ibm.wala.util.collections.Pair<java.lang.Integer,SSAInstruction> getPi(SSAAbstractInvokeInstruction call, SymbolTable symbolTable)
SSAPiNodePolicyIf so, returns a pair consisting of the value number needing renaming, and the instruction which should be recorded as the cause of the pi instruction
getPi in interface SSAPiNodePolicycall - the call instruction in questionsymbolTable - current state of the symbol table for the IR under constructionpublic java.util.List<com.ibm.wala.util.collections.Pair<java.lang.Integer,SSAInstruction>> getPis(SSAConditionalBranchInstruction cond, SSAInstruction def1, SSAInstruction def2, SymbolTable symbolTable)
getPis in interface SSAPiNodePolicy