Class SpecializedInstantiator
- java.lang.Object
-
- com.ibm.wala.dalvik.ipa.callgraph.androidModel.parameters.FlatInstantiator
-
- com.ibm.wala.dalvik.ipa.callgraph.androidModel.parameters.SpecializedInstantiator
-
- All Implemented Interfaces:
IInstantiator
public class SpecializedInstantiator extends FlatInstantiator
Instantiates certain android-types differently. For example instantiating an android.content.Context would pull in all Android-components in scope resulting in a massivly overapproximated model.
-
-
Constructor Summary
Constructors Constructor Description SpecializedInstantiator(VolatileMethodSummary body, TypeSafeInstructionFactory instructionFactory, SSAValueManager pm, IClassHierarchy cha, MethodReference scope, AnalysisScope analysisScope, IInstantiator parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SSAValue
createContext(TypeReference T, boolean asManaged, SSAValue.VariableKey key, Set<? extends SSAValue> seen)
Creates a new instance of android/content/Context.SSAValue
createContextWrapper(TypeReference T, boolean asManaged, SSAValue.VariableKey key, Set<? extends SSAValue> seen)
SSAValue
createInstance(TypeReference T, boolean asManaged, SSAValue.VariableKey key, Set<? extends SSAValue> seen)
Creates a new instance of type calling all that's necessary.int
createInstance(TypeReference type, Object... instantiatorArgs)
Satisfy the interface.static boolean
understands(TypeReference T)
-
Methods inherited from class com.ibm.wala.dalvik.ipa.callgraph.androidModel.parameters.FlatInstantiator
addCallCtor
-
-
-
-
Constructor Detail
-
SpecializedInstantiator
public SpecializedInstantiator(VolatileMethodSummary body, TypeSafeInstructionFactory instructionFactory, SSAValueManager pm, IClassHierarchy cha, MethodReference scope, AnalysisScope analysisScope, IInstantiator parent)
-
-
Method Detail
-
createInstance
public SSAValue createInstance(TypeReference T, boolean asManaged, SSAValue.VariableKey key, Set<? extends 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.- Overrides:
createInstance
in classFlatInstantiator
-
understands
public static boolean understands(TypeReference T)
-
createContext
public SSAValue createContext(TypeReference T, boolean asManaged, SSAValue.VariableKey key, Set<? extends SSAValue> seen)
Creates a new instance of android/content/Context.
-
createContextWrapper
public SSAValue createContextWrapper(TypeReference T, boolean asManaged, SSAValue.VariableKey key, Set<? extends SSAValue> seen)
-
createInstance
public int createInstance(TypeReference type, Object... instantiatorArgs)
Satisfy the interface.- Specified by:
createInstance
in interfaceIInstantiator
- Overrides:
createInstance
in classFlatInstantiator
- Parameters:
type
- Type to generate an instance frominstantiatorArgs
- passed through utility functions- Returns:
- SSA-Number of the instance
-
-