com.ibm.wala.cast.ir.ssa
Class AbstractLexicalInvoke

java.lang.Object
  extended by com.ibm.wala.ssa.SSAInstruction
      extended by com.ibm.wala.ssa.SSAAbstractInvokeInstruction
          extended by com.ibm.wala.cast.ir.ssa.AbstractLexicalInvoke
All Implemented Interfaces:
IInstruction, IInvokeInstruction
Direct Known Subclasses:
FixedParametersLexicalInvokeInstruction, JavaScriptInvoke

public abstract class AbstractLexicalInvoke
extends SSAAbstractInvokeInstruction

This abstract class adds to invoke instructions the ability to handle lexical uses and definitions during call graph construction. The lexical uses and definitions of these objects are initially empty, and get filled in by the AstSSAPropagationCallGraphBuilder, particularly its LexicalOperator objects. This class is still abstract since the lexical scoping functionality is used by multiple languages, each of which has further specializations of invoke instructions.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.wala.ssa.SSAInstruction
SSAInstruction.IVisitor, SSAInstruction.Visitor
 
Nested classes/interfaces inherited from interface com.ibm.wala.shrikeBT.IInvokeInstruction
IInvokeInstruction.Dispatch, IInvokeInstruction.IDispatch
 
Field Summary
protected  AstLexicalAccess.Access[] lexicalReads
           
protected  AstLexicalAccess.Access[] lexicalWrites
           
 
Fields inherited from class com.ibm.wala.ssa.SSAAbstractInvokeInstruction
exception, result, site
 
Constructor Summary
protected AbstractLexicalInvoke(int result, int exception, CallSiteReference site)
           
protected AbstractLexicalInvoke(int result, int exception, CallSiteReference site, AstLexicalAccess.Access[] lexicalReads, AstLexicalAccess.Access[] lexicalWrites)
           
 
Method Summary
 void addLexicalDef(AstLexicalAccess.Access def)
           
 void addLexicalUse(AstLexicalAccess.Access use)
           
 int getDef(int j)
           
 int getLastLexicalUse()
           
 AstLexicalAccess.Access getLexicalDef(int i)
           
 AstLexicalAccess.Access getLexicalUse(int i)
           
 int getNumberOfDefs()
           
 int getNumberOfUses()
          Method getNumberOfUses.
 int getUse(int j)
          Method getUse.
 int hashCode()
           
 boolean isLexicalDef(int def)
           
 boolean isLexicalUse(int use)
           
 java.lang.String toString(SymbolTable symbolTable, ValueDecorator d)
          Method toString.
 
Methods inherited from class com.ibm.wala.ssa.SSAAbstractInvokeInstruction
getCallSite, getDeclaredResultType, getDeclaredTarget, getDef, getException, getInvocationCode, getNumberOfParameters, getProgramCounter, getReceiver, getSite, hasDef, isDispatch, isFallThrough, isPEI, isSpecial, isStatic
 
Methods inherited from class com.ibm.wala.ssa.SSAInstruction
copyForSSA, equals, getExceptionTypes, getValueString, toString, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

lexicalReads

protected AstLexicalAccess.Access[] lexicalReads

lexicalWrites

protected AstLexicalAccess.Access[] lexicalWrites
Constructor Detail

AbstractLexicalInvoke

protected AbstractLexicalInvoke(int result,
                                int exception,
                                CallSiteReference site)

AbstractLexicalInvoke

protected AbstractLexicalInvoke(int result,
                                int exception,
                                CallSiteReference site,
                                AstLexicalAccess.Access[] lexicalReads,
                                AstLexicalAccess.Access[] lexicalWrites)
Method Detail

getNumberOfUses

public int getNumberOfUses()
Description copied from class: SSAInstruction
Method getNumberOfUses.

Overrides:
getNumberOfUses in class SSAInstruction
Returns:
int

getLastLexicalUse

public final int getLastLexicalUse()

getUse

public int getUse(int j)
Description copied from class: SSAInstruction
Method getUse.

Overrides:
getUse in class SSAInstruction
Returns:
value number representing the jth use in this instruction. -1 means TOP (i.e., the value doesn't matter)

getNumberOfDefs

public int getNumberOfDefs()
Overrides:
getNumberOfDefs in class SSAAbstractInvokeInstruction

getDef

public int getDef(int j)
Overrides:
getDef in class SSAAbstractInvokeInstruction

isLexicalUse

public boolean isLexicalUse(int use)

addLexicalUse

public void addLexicalUse(AstLexicalAccess.Access use)

getLexicalUse

public AstLexicalAccess.Access getLexicalUse(int i)

isLexicalDef

public boolean isLexicalDef(int def)

addLexicalDef

public void addLexicalDef(AstLexicalAccess.Access def)

getLexicalDef

public AstLexicalAccess.Access getLexicalDef(int i)

hashCode

public int hashCode()
Specified by:
hashCode in class SSAInstruction

toString

public java.lang.String toString(SymbolTable symbolTable,
                                 ValueDecorator d)
Description copied from class: SSAInstruction
Method toString.

Overrides:
toString in class SSAAbstractInvokeInstruction
Returns:
Object