Class ClassFactoryContextInterpreter
java.lang.Object
com.ibm.wala.analysis.reflection.ClassFactoryContextInterpreter
- All Implemented Interfaces:
CHAContextInterpreter
,RTAContextInterpreter
,SSAContextInterpreter
An
SSAContextInterpreter
specialized to interpret reflective class factories (e.g.
Class.forName()) in a JavaTypeContext
which represents the point-type of the class object
created by the call.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getNumberOfStatements
(CGNode node) iterateCallSites
(CGNode node) iterateFieldsRead
(CGNode node) iterateFieldsWritten
(CGNode node) iterateNewSites
(CGNode node) boolean
recordFactoryType
(CGNode node, IClass klass) record that the "factory" method of a node should be interpreted to allocate a particular class.boolean
understands
(CGNode node) Does this object understand the given method? The caller had better check this before inquiring on other properties.
-
Constructor Details
-
ClassFactoryContextInterpreter
public ClassFactoryContextInterpreter()
-
-
Method Details
-
getIR
- Specified by:
getIR
in interfaceSSAContextInterpreter
- Returns:
- the IR that models the method context, or null if it's an unmodelled native method
-
getIRView
- Specified by:
getIRView
in interfaceSSAContextInterpreter
-
getNumberOfStatements
- Specified by:
getNumberOfStatements
in interfaceSSAContextInterpreter
- Returns:
- the number of the statements in the IR, or -1 if it's an unmodelled native method.
-
understands
Description copied from interface:CHAContextInterpreter
Does this object understand the given method? The caller had better check this before inquiring on other properties.- Specified by:
understands
in interfaceCHAContextInterpreter
- See Also:
-
iterateNewSites
- Specified by:
iterateNewSites
in interfaceCHAContextInterpreter
- Specified by:
iterateNewSites
in interfaceRTAContextInterpreter
- Returns:
- an Iterator of the types that may be allocated by a given method in a given context.
- See Also:
-
iterateCallSites
- Specified by:
iterateCallSites
in interfaceCHAContextInterpreter
- Returns:
- an Iterator of the call statements that may execute in a given method for a given context
- See Also:
-
recordFactoryType
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?
- Specified by:
recordFactoryType
in interfaceRTAContextInterpreter
- Returns:
- true iff a NEW type was recorded, false if the type was previously recorded.
-
iterateFieldsRead
- Specified by:
iterateFieldsRead
in interfaceRTAContextInterpreter
- Returns:
- iterator of FieldReference
-
iterateFieldsWritten
- Specified by:
iterateFieldsWritten
in interfaceRTAContextInterpreter
- Returns:
- iterator of FieldReference
-
getCFG
- Specified by:
getCFG
in interfaceSSAContextInterpreter
-
getDU
- Specified by:
getDU
in interfaceSSAContextInterpreter
- Returns:
- DefUse for the IR that models the method context, or null if it's an unmodelled native method
-