com.ibm.wala.ssa
Class InstanceOfPiPolicy

java.lang.Object
  extended by com.ibm.wala.ssa.InstanceOfPiPolicy
All Implemented Interfaces:
SSAPiNodePolicy

public class InstanceOfPiPolicy
extends java.lang.Object
implements SSAPiNodePolicy

A pi node policy with the following rule: 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.


Method Summary
static InstanceOfPiPolicy createInstanceOfPiPolicy()
           
 boolean equals(java.lang.Object obj)
           
 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? If 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
 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? If 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
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInstanceOfPiPolicy

public static InstanceOfPiPolicy createInstanceOfPiPolicy()

getPi

public Pair<java.lang.Integer,SSAInstruction> getPi(SSAConditionalBranchInstruction cond,
                                                    SSAInstruction def1,
                                                    SSAInstruction def2,
                                                    SymbolTable symbolTable)
Description copied from interface: SSAPiNodePolicy
Do we need to introduce a new name for some value after deciding on an outcome for a conditional branch instruction? If 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

Specified by:
getPi in interface SSAPiNodePolicy
Parameters:
cond - the conditional branch instruction in question
def1 - the SSAInstruction that defs cond.getUse(0), or null if none
def2 - the SSAInstruction that defs cond.getUse(1), or null if none
symbolTable - current state of the symbol table for the IR under construction
Returns:
description of the necessary pi instruction, or null if no pi instruction is needed.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getPi

public Pair<java.lang.Integer,SSAInstruction> getPi(SSAAbstractInvokeInstruction call,
                                                    SymbolTable symbolTable)
Description copied from interface: SSAPiNodePolicy
Do we need to introduce a new name for some value immediately after a call? If 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

Specified by:
getPi in interface SSAPiNodePolicy
Parameters:
call - the call instruction in question
symbolTable - current state of the symbol table for the IR under construction
Returns:
description of the necessary pi instruction, or null if no pi instruction is needed.