public class ReuseParameters
extends java.lang.Object
Parameters used in a model can be either marked as CREATE or REUSE. This information is derived from the IInstantiationBehavior.
This class only handles parameters marked as REUSE: These will be parameters to the function representing the model itself. On all uses of a variable named REUSE the same Instance (optionally altered using Phi) will be used.
ReuseParameters collects all those parameters and builds the Descriptor of the later model.
Also ReuseParameters may be queried how to access these parameters the use of ParameterAccessor is the better way to get them.
IInstantiationBehavior,
ParameterAccessor| Modifier and Type | Class and Description |
|---|---|
static class |
ReuseParameters.ReuseParameter |
| Constructor and Description |
|---|
ReuseParameters(IInstantiationBehavior instanceBehavior,
AndroidModel forModel) |
| Modifier and Type | Method and Description |
|---|---|
void |
collectParameters(java.lang.Iterable<? extends com.ibm.wala.ipa.callgraph.Entrypoint> entrypoints)
Searches the given entrypoints for those parameters.
|
boolean |
isReuse(com.ibm.wala.types.TypeName param,
com.ibm.wala.classLoader.IMethod inCallTo)
Is the parameter REUSE in a call from forModel to inCallTo.
|
com.ibm.wala.types.MethodReference |
toMethodReference(AndroidModelParameterManager pm) |
public ReuseParameters(IInstantiationBehavior instanceBehavior, AndroidModel forModel)
instanceBehavior - The Behavior to query if the parameter is REUSEforModel - The AndroidModel in which context the status is to be determinedpublic void collectParameters(java.lang.Iterable<? extends com.ibm.wala.ipa.callgraph.Entrypoint> entrypoints)
A call to this function resets the internal knowledge of REUSE-Parameters. So in order to get a union of these parameters a union of the given entrypoints has to be built.
entrypoints - The entrypoints to consider in the search.public boolean isReuse(com.ibm.wala.types.TypeName param,
com.ibm.wala.classLoader.IMethod inCallTo)
The 'forModel' was set in the constructor. Even so a parameter occurs in the descriptor it does not have to be REUSE for all calls.
The result of this method may vary over time :/
param - The parameter in question of being reuseinCallTo - The callee to query the REUSEness forpublic com.ibm.wala.types.MethodReference toMethodReference(AndroidModelParameterManager pm)