Class ClassNewInstanceContextInterpreter

java.lang.Object
com.ibm.wala.analysis.reflection.AbstractReflectionInterpreter
com.ibm.wala.analysis.reflection.ClassNewInstanceContextInterpreter
All Implemented Interfaces:
CHAContextInterpreter, RTAContextInterpreter, SSAContextInterpreter

public class ClassNewInstanceContextInterpreter extends AbstractReflectionInterpreter
An SSAContextInterpreter specialized to interpret Class.newInstance in a JavaTypeContext which represents the point-type of the class object created by the call.
  • Field Details

    • newInstanceAtom

      public static final Atom newInstanceAtom
    • CLASS_NEW_INSTANCE_REF

      public static final MethodReference CLASS_NEW_INSTANCE_REF
  • Constructor Details

    • ClassNewInstanceContextInterpreter

      public ClassNewInstanceContextInterpreter(IClassHierarchy cha)
  • Method Details

    • getIR

      public IR getIR(CGNode node)
      Returns:
      the IR that models the method context, or null if it's an unmodelled native method
    • getIRView

      public IRView getIRView(CGNode node)
    • getNumberOfStatements

      public int getNumberOfStatements(CGNode node)
      Returns:
      the number of the statements in the IR, or -1 if it's an unmodelled native method.
    • understands

      public boolean understands(CGNode node)
      Description copied from interface: CHAContextInterpreter
      Does this object understand the given method? The caller had better check this before inquiring on other properties.
    • iterateNewSites

      public Iterator<NewSiteReference> iterateNewSites(CGNode node)
      Returns:
      an Iterator of the types that may be allocated by a given method in a given context.
    • iterateCallSites

      public Iterator<CallSiteReference> iterateCallSites(CGNode node)
      Returns:
      an Iterator of the call statements that may execute in a given method for a given context
    • recordFactoryType

      public boolean recordFactoryType(CGNode node, IClass klass)
      Description copied from interface: RTAContextInterpreter
      record that the "factory" method of a node should be interpreted to allocate a particular class.

      TODO: this is a little ugly, is there a better place to move this?

      Returns:
      true iff a NEW type was recorded, false if the type was previously recorded.
    • iterateFieldsRead

      public Iterator<FieldReference> iterateFieldsRead(CGNode node)
      Returns:
      iterator of FieldReference
    • iterateFieldsWritten

      public Iterator<FieldReference> iterateFieldsWritten(CGNode node)
      Returns:
      iterator of FieldReference
    • getCFG

    • getDU

      public DefUse getDU(CGNode node)
      Returns:
      DefUse for the IR that models the method context, or null if it's an unmodelled native method