java.lang.Object
com.ibm.wala.dalvik.ipa.callgraph.androidModel.parameters.FlatInstantiator
All Implemented Interfaces:
com.ibm.wala.core.util.ssa.IInstantiator
Direct Known Subclasses:
SpecializedInstantiator

public class FlatInstantiator extends Object implements com.ibm.wala.core.util.ssa.IInstantiator
Add code to create an instance of a type in a synthetic method.

This variant limits recursion depth.

  • Constructor Summary

    Constructors
    Constructor
    Description
    FlatInstantiator(com.ibm.wala.ipa.summaries.VolatileMethodSummary body, com.ibm.wala.core.util.ssa.TypeSafeInstructionFactory instructionFactory, com.ibm.wala.core.util.ssa.SSAValueManager pm, com.ibm.wala.ipa.cha.IClassHierarchy cha, com.ibm.wala.types.MethodReference scope, com.ibm.wala.ipa.callgraph.AnalysisScope analysisScope)
     
    FlatInstantiator(com.ibm.wala.ipa.summaries.VolatileMethodSummary body, com.ibm.wala.core.util.ssa.TypeSafeInstructionFactory instructionFactory, com.ibm.wala.core.util.ssa.SSAValueManager pm, com.ibm.wala.ipa.cha.IClassHierarchy cha, com.ibm.wala.types.MethodReference scope, com.ibm.wala.ipa.callgraph.AnalysisScope analysisScope, int maxDepth)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addCallCtor(com.ibm.wala.core.util.ssa.SSAValue self, com.ibm.wala.types.MethodReference ctor, List<com.ibm.wala.core.util.ssa.SSAValue> ctorParams)
    Add a call to the given constructor to the body.
    com.ibm.wala.core.util.ssa.SSAValue
    createInstance(com.ibm.wala.types.TypeReference T, boolean asManaged, com.ibm.wala.core.util.ssa.SSAValue.VariableKey key, Set<? extends com.ibm.wala.core.util.ssa.SSAValue> seen)
    Creates a new instance of type calling all that's necessary.
    int
    createInstance(com.ibm.wala.types.TypeReference type, Object... instantiatorArgs)
    Satisfy the interface.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FlatInstantiator

      public FlatInstantiator(com.ibm.wala.ipa.summaries.VolatileMethodSummary body, com.ibm.wala.core.util.ssa.TypeSafeInstructionFactory instructionFactory, com.ibm.wala.core.util.ssa.SSAValueManager pm, com.ibm.wala.ipa.cha.IClassHierarchy cha, com.ibm.wala.types.MethodReference scope, com.ibm.wala.ipa.callgraph.AnalysisScope analysisScope)
    • FlatInstantiator

      public FlatInstantiator(com.ibm.wala.ipa.summaries.VolatileMethodSummary body, com.ibm.wala.core.util.ssa.TypeSafeInstructionFactory instructionFactory, com.ibm.wala.core.util.ssa.SSAValueManager pm, com.ibm.wala.ipa.cha.IClassHierarchy cha, com.ibm.wala.types.MethodReference scope, com.ibm.wala.ipa.callgraph.AnalysisScope analysisScope, int maxDepth)
  • Method Details

    • createInstance

      public com.ibm.wala.core.util.ssa.SSAValue createInstance(com.ibm.wala.types.TypeReference T, boolean asManaged, com.ibm.wala.core.util.ssa.SSAValue.VariableKey key, Set<? extends com.ibm.wala.core.util.ssa.SSAValue> seen)
      Creates a new instance of type calling all that's necessary.

      If T is a class-type all its constructors are searched for the one found best suited (takes the least arguments, ...). New instances are created for all parameters, then the constructor is called.

      If T represents multiple types (is an interface, abstract class, ...) _all_ implementors of that type are instantiated After that they get Phi-ed together.

      If T is an array-type a new array of length 1 is generated.

      TODO: Do we want to mix in REUSE-Parameters?

    • addCallCtor

      protected void addCallCtor(com.ibm.wala.core.util.ssa.SSAValue self, com.ibm.wala.types.MethodReference ctor, List<com.ibm.wala.core.util.ssa.SSAValue> ctorParams)
      Add a call to the given constructor to the body.
      Parameters:
      self - the "this" to call the constructor on
      ctor - the constructor to call
      ctorParams - parameters to the ctor _without_ implicit this
    • createInstance

      public int createInstance(com.ibm.wala.types.TypeReference type, Object... instantiatorArgs)
      Satisfy the interface.
      Specified by:
      createInstance in interface com.ibm.wala.core.util.ssa.IInstantiator