Package com.ibm.wala.analysis.reflection
Class CloneInterpreter
- java.lang.Object
-
- com.ibm.wala.analysis.reflection.CloneInterpreter
-
- All Implemented Interfaces:
CHAContextInterpreter
,RTAContextInterpreter
,SSAContextInterpreter
public class CloneInterpreter extends java.lang.Object implements SSAContextInterpreter
A context interpreter for java.lang.Object.cloneTODO: The current implementation does not model CloneNotSupportedExceptions
-
-
Field Summary
Fields Modifier and Type Field Description static MethodReference
CLONE
Comment forCLONE
static Atom
cloneAtom
Comment forcloneAtom
-
Constructor Summary
Constructors Constructor Description CloneInterpreter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<TypeReference>
getCaughtExceptions(CGNode node)
ControlFlowGraph<SSAInstruction,ISSABasicBlock>
getCFG(CGNode N)
DefUse
getDU(CGNode node)
IR
getIR(CGNode node)
IRView
getIRView(CGNode node)
int
getNumberOfStatements(CGNode node)
boolean
hasObjectArrayLoad(CGNode node)
boolean
hasObjectArrayStore(CGNode node)
java.util.Iterator<CallSiteReference>
iterateCallSites(CGNode node)
java.util.Iterator<TypeReference>
iterateCastTypes(CGNode node)
java.util.Iterator<FieldReference>
iterateFieldsRead(CGNode node)
java.util.Iterator<FieldReference>
iterateFieldsWritten(CGNode node)
java.util.Iterator<NewSiteReference>
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.
-
-
-
Field Detail
-
cloneAtom
public static final Atom cloneAtom
Comment forcloneAtom
-
CLONE
public static final MethodReference CLONE
Comment forCLONE
-
-
Method Detail
-
getIR
public IR getIR(CGNode node)
- Specified by:
getIR
in interfaceSSAContextInterpreter
- Returns:
- the IR that models the method context, or null if it's an unmodelled native method
-
getIRView
public IRView getIRView(CGNode node)
- Specified by:
getIRView
in interfaceSSAContextInterpreter
-
getNumberOfStatements
public int getNumberOfStatements(CGNode node)
- Specified by:
getNumberOfStatements
in interfaceSSAContextInterpreter
- 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.- Specified by:
understands
in interfaceCHAContextInterpreter
-
iterateNewSites
public java.util.Iterator<NewSiteReference> iterateNewSites(CGNode node)
- 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.
-
iterateCallSites
public java.util.Iterator<CallSiteReference> iterateCallSites(CGNode node)
- Specified by:
iterateCallSites
in interfaceCHAContextInterpreter
- 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?
- Specified by:
recordFactoryType
in interfaceRTAContextInterpreter
- Returns:
- true iff a NEW type was recorded, false if the type was previously recorded.
-
iterateFieldsRead
public java.util.Iterator<FieldReference> iterateFieldsRead(CGNode node)
- Specified by:
iterateFieldsRead
in interfaceRTAContextInterpreter
- Returns:
- iterator of FieldReference
-
iterateFieldsWritten
public java.util.Iterator<FieldReference> iterateFieldsWritten(CGNode node)
- Specified by:
iterateFieldsWritten
in interfaceRTAContextInterpreter
- Returns:
- iterator of FieldReference
-
getCaughtExceptions
public java.util.Set<TypeReference> getCaughtExceptions(CGNode node)
-
hasObjectArrayLoad
public boolean hasObjectArrayLoad(CGNode node)
-
hasObjectArrayStore
public boolean hasObjectArrayStore(CGNode node)
-
iterateCastTypes
public java.util.Iterator<TypeReference> iterateCastTypes(CGNode node)
-
getCFG
public ControlFlowGraph<SSAInstruction,ISSABasicBlock> getCFG(CGNode N)
- Specified by:
getCFG
in interfaceSSAContextInterpreter
-
getDU
public DefUse getDU(CGNode node)
- Specified by:
getDU
in interfaceSSAContextInterpreter
- Returns:
- DefUse for the IR that models the method context, or null if it's an unmodelled native method
-
-