Class FallbackContextInterpreter
java.lang.Object
com.ibm.wala.ipa.callgraph.propagation.cfa.FallbackContextInterpreter
- All Implemented Interfaces:
CHAContextInterpreter, RTAContextInterpreter, SSAContextInterpreter
This ContextInterpreter can be used when using another WALA frontend than the shrike frontend.
WALA's standard ContextInterpreters, like e.g. DefaultSSAInterpreter delegate to CodeScanner,
which assumes, that the provided methods are instances of shrike classes. When using these
ContextInterpreter with another frontend than shrike, this leads to ClassCastExceptions. This
class can be used to work around this issue. It delegates to a given ContextInterpreter, if the
CGNode's IMethod is a Shrike class. Otherwise, it retrieves the required information from the
CGNode's IR, which should always work.
- Author:
- Martin Mohr <martin.mohr@kit.edu>
This class is provided by the JOANA project (joana.ipd.kit.edu).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetNumberOfStatements(CGNode node) iterateCallSites(CGNode node) iterateFieldsRead(CGNode node) iterateFieldsWritten(CGNode node) iterateNewSites(CGNode node) booleanrecordFactoryType(CGNode node, IClass klass) record that the "factory" method of a node should be interpreted to allocate a particular class.booleanunderstands(CGNode node) Does this object understand the given method? The caller had better check this before inquiring on other properties.
-
Constructor Details
-
FallbackContextInterpreter
-
-
Method Details
-
iterateNewSites
- Specified by:
iterateNewSitesin interfaceCHAContextInterpreter- Specified by:
iterateNewSitesin interfaceRTAContextInterpreter- Returns:
- an Iterator of the types that may be allocated by a given method in a given context.
-
iterateFieldsRead
- Specified by:
iterateFieldsReadin interfaceRTAContextInterpreter- Returns:
- iterator of FieldReference
-
iterateFieldsWritten
- Specified by:
iterateFieldsWrittenin interfaceRTAContextInterpreter- Returns:
- iterator of FieldReference
-
iterateCallSites
- Specified by:
iterateCallSitesin interfaceCHAContextInterpreter- Returns:
- an Iterator of the call statements that may execute in a given method for a given context
-
recordFactoryType
Description copied from interface:RTAContextInterpreterrecord 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:
recordFactoryTypein interfaceRTAContextInterpreter- Returns:
- true iff a NEW type was recorded, false if the type was previously recorded.
-
understands
Description copied from interface:CHAContextInterpreterDoes this object understand the given method? The caller had better check this before inquiring on other properties.- Specified by:
understandsin interfaceCHAContextInterpreter
-
getIR
- Specified by:
getIRin interfaceSSAContextInterpreter- Returns:
- the IR that models the method context, or null if it's an unmodelled native method
-
getIRView
- Specified by:
getIRViewin interfaceSSAContextInterpreter
-
getDU
- Specified by:
getDUin interfaceSSAContextInterpreter- Returns:
- DefUse for the IR that models the method context, or null if it's an unmodelled native method
-
getNumberOfStatements
- Specified by:
getNumberOfStatementsin interfaceSSAContextInterpreter- Returns:
- the number of the statements in the IR, or -1 if it's an unmodelled native method.
-
getCFG
- Specified by:
getCFGin interfaceSSAContextInterpreter
-