com.ibm.wala.ipa.callgraph.propagation.cfa
Class ZeroXInstanceKeys

java.lang.Object
  extended by com.ibm.wala.ipa.callgraph.propagation.cfa.ZeroXInstanceKeys
All Implemented Interfaces:
InstanceKeyFactory

public class ZeroXInstanceKeys
extends java.lang.Object
implements InstanceKeyFactory


Field Summary
static int ALLOCATIONS
          An ALLOCATIONS - based policy distinguishes instances by allocation site.
static TypeReference JavaLangStringBuffer
           
static int NONE
          The NONE policy is not allocation-site based
static int SMUSH_MANY
          This variant counts the N, number of allocation sites of a particular type T in each method.
static int SMUSH_PRIMITIVE_HOLDERS
          A policy variant where if a type T has only primitive instance fields, then instances of type T are NOT disambiguated by allocation site.
static int SMUSH_STRINGS
          A policy variant where String and StringBuffers are NOT disambiguated according to allocation site.
static int SMUSH_THROWABLES
          A policy variant where Throwable instances are NOT disambiguated according to allocation site.
 
Constructor Summary
ZeroXInstanceKeys(AnalysisOptions options, ClassHierarchy cha, RTAContextInterpreter contextInterpreter, WarningSet warnings, int policy)
           
 
Method Summary
protected  ClassHierarchy getClassHierarchy()
           
 InstanceKey getInstanceKeyForAllocation(CGNode node, NewSiteReference allocation)
           
 InstanceKey getInstanceKeyForClassObject(TypeReference type)
           
 InstanceKey getInstanceKeyForConstant(java.lang.Object S)
           
 InstanceKey getInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim)
           
 InstanceKey getInstanceKeyForPEI(CGNode node, ProgramCounter pei, TypeReference type)
           
 java.lang.String getStringConstantForInstanceKey(InstanceKey I)
           
 boolean isInteresting(IClass C)
          A class is "interesting" iff we distinguish instances of the class
 boolean isStackTraceElement(IClass C)
           
static boolean isStringish(IClass C)
           
 boolean isThrowable(IClass C)
           
 boolean smushThrowables()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JavaLangStringBuffer

public static final TypeReference JavaLangStringBuffer

NONE

public static final int NONE
The NONE policy is not allocation-site based

See Also:
Constant Field Values

ALLOCATIONS

public static final int ALLOCATIONS
An ALLOCATIONS - based policy distinguishes instances by allocation site. Otherwise, the policy distinguishes instances by type.

See Also:
Constant Field Values

SMUSH_STRINGS

public static final int SMUSH_STRINGS
A policy variant where String and StringBuffers are NOT disambiguated according to allocation site.

See Also:
Constant Field Values

SMUSH_THROWABLES

public static final int SMUSH_THROWABLES
A policy variant where Throwable instances are NOT disambiguated according to allocation site.

See Also:
Constant Field Values

SMUSH_PRIMITIVE_HOLDERS

public static final int SMUSH_PRIMITIVE_HOLDERS
A policy variant where if a type T has only primitive instance fields, then instances of type T are NOT disambiguated by allocation site.

See Also:
Constant Field Values

SMUSH_MANY

public static final int SMUSH_MANY
This variant counts the N, number of allocation sites of a particular type T in each method. If N > SMUSH_LIMIT, then these N allocation sites are NOT distinguished ... instead there is a single abstract allocation site for Probably the best choice in many cases.

See Also:
Constant Field Values
Constructor Detail

ZeroXInstanceKeys

public ZeroXInstanceKeys(AnalysisOptions options,
                         ClassHierarchy cha,
                         RTAContextInterpreter contextInterpreter,
                         WarningSet warnings,
                         int policy)
Parameters:
options -
cha -
warnings -
policy -
Method Detail

smushThrowables

public boolean smushThrowables()

getInstanceKeyForAllocation

public InstanceKey getInstanceKeyForAllocation(CGNode node,
                                               NewSiteReference allocation)
Specified by:
getInstanceKeyForAllocation in interface InstanceKeyFactory
Returns:
the instance key that represents a particular allocation

getInstanceKeyForMultiNewArray

public InstanceKey getInstanceKeyForMultiNewArray(CGNode node,
                                                  NewSiteReference allocation,
                                                  int dim)
Specified by:
getInstanceKeyForMultiNewArray in interface InstanceKeyFactory
Returns:
the instance key that represents the array allocated as the dimth dimension at a particular allocation

getInstanceKeyForConstant

public InstanceKey getInstanceKeyForConstant(java.lang.Object S)
Specified by:
getInstanceKeyForConstant in interface InstanceKeyFactory
Returns:
the instance key that represents a constant with value S

getStringConstantForInstanceKey

public java.lang.String getStringConstantForInstanceKey(InstanceKey I)
Specified by:
getStringConstantForInstanceKey in interface InstanceKeyFactory
Returns:
if I was allocated by this for a specific string constant, return that constant (return null otherwise).

getInstanceKeyForPEI

public InstanceKey getInstanceKeyForPEI(CGNode node,
                                        ProgramCounter pei,
                                        TypeReference type)
Specified by:
getInstanceKeyForPEI in interface InstanceKeyFactory
Returns:
the instance key that represents the exception of type _type_ thrown by a particular PEI.

getInstanceKeyForClassObject

public InstanceKey getInstanceKeyForClassObject(TypeReference type)
Specified by:
getInstanceKeyForClassObject in interface InstanceKeyFactory
Returns:
the instance key that represents the class object of type _type_.

isInteresting

public boolean isInteresting(IClass C)
A class is "interesting" iff we distinguish instances of the class


isStringish

public static boolean isStringish(IClass C)

isThrowable

public boolean isThrowable(IClass C)

isStackTraceElement

public boolean isStackTraceElement(IClass C)

getClassHierarchy

protected ClassHierarchy getClassHierarchy()
Returns:
Returns the cha.