public class ProgramMethodOptimizationInfo extends MethodOptimizationInfo
hasNoEscapingParameters, hasNoExternalReturnValues, hasNoExternalSideEffects, hasNoSideEffects, returnValue| Constructor and Description |
|---|
ProgramMethodOptimizationInfo(proguard.classfile.Clazz clazz,
proguard.classfile.Method method)
Creates a new MethodOptimizationInfo for the given method.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accessesPackageCode()
Returns whether the method body accesses any package visible fields or
methods.
|
boolean |
accessesPrivateCode()
Returns whether the method body accesses any private fields or methods.
|
boolean |
accessesProtectedCode()
Returns whether the method body accesses any protected fields or methods.
|
boolean |
assignsFinalField()
Returns whether the method body assigns any values to final fields.
|
boolean |
branchesBackward()
Returns whether the method body contains any backward branches.
|
boolean |
canBeMadePrivate()
Returns whether the method can be made private.
|
boolean |
catchesExceptions()
Returns whether the method body contains any exception handlers.
|
void |
generalizeParameterValue(int parameterIndex,
proguard.evaluation.value.Value parameter)
Specifies a possible representation of the specified method parameter.
|
void |
generalizeReturnValue(proguard.evaluation.value.Value returnValue)
Specifies a representation of the value that the method returns, or null
if it is unknown.
|
long |
getEscapedParameters()
Returns a mask with the reference parameters have already escaped to
the heap when entering the method.
|
long |
getEscapingParameters()
Returns a mask with the parameters that escape from the method.
|
int |
getInvocationCount()
Returns the number of times the method is invoked in the known code
base.
|
long |
getModifiedParameters()
Returns a mask of the reference parameters whose contents are modified
in the method.
|
int |
getParameterSize()
Returns the size that the parameters of the method take up on the stack.
|
int |
getParameterSize(int parameterIndex)
Returns the stack size of the parameter at the given index.
|
proguard.evaluation.value.Value |
getParameterValue(int parameterIndex)
Returns a representation of the specified method parameter, or null
if it is unknown.
|
static ProgramMethodOptimizationInfo |
getProgramMethodOptimizationInfo(proguard.classfile.Method method)
Returns the ProgramMethodOptimizationInfo instance from the specified
chain of linked methods.
|
long |
getReturnedParameters()
Returns a mask of the reference parameters that the method might return.
|
long |
getUsedParameters()
Returns a mask with the parameters that the method actually uses.
|
boolean |
hasParameterEscaped(int parameterIndex)
Returns whether the specified reference parameter has already escaped
to the heap when entering the method.
|
boolean |
hasSideEffects()
Returns whether the method has side effects.
|
boolean |
hasSynchronizedBlock()
Returns whether the method body contains any synchronization code
('monitorenter' and 'monitorexit').
|
boolean |
hasUnusedParameters()
Returns whether the method has any unused parameters.
|
void |
incrementInvocationCount()
Increments the counter for number of times the method is invoked in the
known code base.
|
void |
insertParameter(int parameterIndex,
int stackSize)
Notifies this object that a parameter is inserted at the given
index with the given stack size.
|
boolean |
invokesDynamically()
Returns whether the method body invokes any methods with
'invokedynamic'.
|
boolean |
invokesSuperMethods()
Returns whether the method body invokes any super methods.
|
boolean |
isKept()
Returns whether the method is kept.
|
boolean |
isParameterEscaping(int parameterIndex)
Returns whether the specified parameter escapes from the method.
|
boolean |
isParameterModified(int parameterIndex)
Returns whether the contents of the specified reference parameter are
modified in the method.
|
boolean |
isParameterUsed(int variableIndex)
Returns whether the method actually uses the specified parameter.
|
void |
merge(MethodOptimizationInfo other)
Merges in the given information of a method that is inlined.
|
boolean |
modifiesAnything()
Returns whether the method might modify objects that it can reach
through static fields or instance fields.
|
void |
removeParameter(int parameterIndex)
Notifies this object that the specified parameter is removed.
|
boolean |
returnsExternalValues()
Returns whether the method might return external values.
|
boolean |
returnsNewInstances()
Returns whether the method might create and return new instances.
|
boolean |
returnsParameter(int parameterIndex)
Returns whether the method might return the specified reference
parameter as its result.
|
boolean |
returnsWithNonEmptyStack()
Returns whether the method body contains `return` instructions that
leave a non-empty stack.
|
void |
setAccessesPackageCode()
Specifies that the method body accesses package visible fields or
methods.
|
void |
setAccessesPrivateCode()
Specifies that the method body accesses private fields or methods.
|
void |
setAccessesProtectedCode()
Specifies that the method body accesses protected fields or methods.
|
void |
setAssignsFinalField()
Specifies that the method body assigns values to final fields.
|
void |
setBranchesBackward()
Specifies that the method body contains backward branches.
|
void |
setCanNotBeMadePrivate()
Specifies that the method can't be made private.
|
void |
setCatchesExceptions()
Specifies that the method body contains exception handlers.
|
void |
setHasSynchronizedBlock()
Specifies that the method body contains synchronization code
('monitorenter' and 'monitorexit').
|
void |
setInvokesDynamically()
Specifies that the method body invokes methods with
'invokedynamic'.
|
void |
setInvokesSuperMethods()
Specifies that the method body invokes super methods.
|
void |
setModifiesAnything()
Specifies that the method might modify objects that it can reach
through static fields or instance fields.
|
void |
setParameterEscaped(int parameterIndex)
Specifies that the specified reference parameter has already escaped
to the heap when entering the method.
|
void |
setParameterEscaping(int parameterIndex)
Specifies that the specified parameter escapes from the method.
|
void |
setParameterModified(int parameterIndex)
Specifies that the contents of the specified reference parameter are
modified in the method.
|
void |
setParameterReturned(int parameterIndex)
Specifies that the method might return the specified reference parameter
as its result.
|
void |
setParameterSize(int parameterSize)
Specifies the size that the parameters of the method take up on the stack.
|
void |
setParameterUsed(int variableIndex)
Specifies that the method actually uses the specified parameter.
|
static void |
setProgramMethodOptimizationInfo(proguard.classfile.Clazz clazz,
proguard.classfile.Method method)
Creates and sets a ProgramMethodOptimizationInfo instance on the
specified chain of linked methods.
|
void |
setReturnsExternalValues()
Specifies that the method might return external values.
|
void |
setReturnsNewInstances()
Specifies that the method might create and return new instances.
|
void |
setReturnsWithNonEmptyStack()
Specifies that the method body contains `return` instructions that
leave a non-empty stack.
|
void |
setSideEffects()
Specifies that the method has side effects.
|
void |
updateEscapedParameters(long escapedParameters)
Specifies a mask with the reference parameters have already escaped to
the heap when entering the method.
|
void |
updateEscapingParameters(long escapingParameters)
Specifies a mask with the parameters that escape from the method.
|
void |
updateModifiedParameters(long modifiedParameters)
Specifies a mask of the reference parameters whose contents are modified
in the method.
|
void |
updateReturnedParameters(long returnedParameters)
Specifies a mask of the reference parameters that the method might return.
|
void |
updateUsedParameters(long usedParameters)
Specifies a mask with the parameters that the method actually uses.
|
getMethodOptimizationInfo, getReturnValue, hasNoEscapingParameters, hasNoExternalReturnValues, hasNoExternalSideEffects, hasNoSideEffects, setMethodOptimizationInfo, setNoEscapingParameters, setNoExternalReturnValues, setNoExternalSideEffects, setNoSideEffects, setReturnValuepublic ProgramMethodOptimizationInfo(proguard.classfile.Clazz clazz,
proguard.classfile.Method method)
public boolean isKept()
MethodOptimizationInfoisKept in class MethodOptimizationInfopublic void setSideEffects()
MethodOptimizationInfo.setNoSideEffects() gets precedence.public boolean hasSideEffects()
MethodOptimizationInfohasSideEffects in class MethodOptimizationInfopublic void setCanNotBeMadePrivate()
public boolean canBeMadePrivate()
MethodOptimizationInfocanBeMadePrivate in class MethodOptimizationInfopublic void setCatchesExceptions()
public boolean catchesExceptions()
MethodOptimizationInfocatchesExceptions in class MethodOptimizationInfopublic void setBranchesBackward()
public boolean branchesBackward()
MethodOptimizationInfobranchesBackward in class MethodOptimizationInfopublic void setInvokesSuperMethods()
public boolean invokesSuperMethods()
MethodOptimizationInfoinvokesSuperMethods in class MethodOptimizationInfopublic void setInvokesDynamically()
public boolean invokesDynamically()
MethodOptimizationInfoinvokesDynamically in class MethodOptimizationInfopublic void setAccessesPrivateCode()
public boolean accessesPrivateCode()
MethodOptimizationInfoaccessesPrivateCode in class MethodOptimizationInfopublic void setAccessesPackageCode()
public boolean accessesPackageCode()
MethodOptimizationInfoaccessesPackageCode in class MethodOptimizationInfopublic void setAccessesProtectedCode()
public boolean accessesProtectedCode()
MethodOptimizationInfoaccessesProtectedCode in class MethodOptimizationInfopublic void setHasSynchronizedBlock()
public boolean hasSynchronizedBlock()
MethodOptimizationInfohasSynchronizedBlock in class MethodOptimizationInfopublic void setAssignsFinalField()
public boolean assignsFinalField()
MethodOptimizationInfoassignsFinalField in class MethodOptimizationInfopublic void setReturnsWithNonEmptyStack()
public boolean returnsWithNonEmptyStack()
MethodOptimizationInforeturnsWithNonEmptyStack in class MethodOptimizationInfopublic void incrementInvocationCount()
public int getInvocationCount()
MethodOptimizationInfogetInvocationCount in class MethodOptimizationInfopublic void setParameterSize(int parameterSize)
public int getParameterSize()
MethodOptimizationInfogetParameterSize in class MethodOptimizationInfopublic int getParameterSize(int parameterIndex)
public void setParameterUsed(int variableIndex)
public void updateUsedParameters(long usedParameters)
public boolean hasUnusedParameters()
MethodOptimizationInfohasUnusedParameters in class MethodOptimizationInfopublic boolean isParameterUsed(int variableIndex)
MethodOptimizationInfoisParameterUsed in class MethodOptimizationInfopublic long getUsedParameters()
MethodOptimizationInfogetUsedParameters in class MethodOptimizationInfopublic void insertParameter(int parameterIndex,
int stackSize)
parameterIndex - the parameter index,
not taking into account the entry size,
but taking into account the 'this' parameter,
if any.stackSize - the stack size that is occupied by the inserted
parameter.public void removeParameter(int parameterIndex)
parameterIndex - the parameter index,
not taking into account the entry size,
but taking into account the 'this' parameter,
if any.public void setParameterEscaped(int parameterIndex)
public void updateEscapedParameters(long escapedParameters)
public boolean hasParameterEscaped(int parameterIndex)
MethodOptimizationInfohasParameterEscaped in class MethodOptimizationInfopublic long getEscapedParameters()
MethodOptimizationInfogetEscapedParameters in class MethodOptimizationInfopublic void setParameterEscaping(int parameterIndex)
public void updateEscapingParameters(long escapingParameters)
public boolean isParameterEscaping(int parameterIndex)
MethodOptimizationInfoisParameterEscaping in class MethodOptimizationInfopublic long getEscapingParameters()
MethodOptimizationInfogetEscapingParameters in class MethodOptimizationInfopublic void setParameterModified(int parameterIndex)
MethodOptimizationInfo.setNoSideEffects() and
MethodOptimizationInfo.setNoExternalSideEffects() get precedence.public void updateModifiedParameters(long modifiedParameters)
MethodOptimizationInfo.setNoSideEffects() and
MethodOptimizationInfo.setNoExternalSideEffects() get precedence.public boolean isParameterModified(int parameterIndex)
MethodOptimizationInfoisParameterModified in class MethodOptimizationInfopublic long getModifiedParameters()
MethodOptimizationInfogetModifiedParameters in class MethodOptimizationInfopublic void setModifiesAnything()
MethodOptimizationInfo.setNoExternalSideEffects() gets precedence.public boolean modifiesAnything()
MethodOptimizationInfomodifiesAnything in class MethodOptimizationInfopublic void generalizeParameterValue(int parameterIndex,
proguard.evaluation.value.Value parameter)
public proguard.evaluation.value.Value getParameterValue(int parameterIndex)
MethodOptimizationInfogetParameterValue in class MethodOptimizationInfopublic void setParameterReturned(int parameterIndex)
public void updateReturnedParameters(long returnedParameters)
public boolean returnsParameter(int parameterIndex)
MethodOptimizationInforeturnsParameter in class MethodOptimizationInfopublic long getReturnedParameters()
MethodOptimizationInfogetReturnedParameters in class MethodOptimizationInfopublic void setReturnsNewInstances()
public boolean returnsNewInstances()
MethodOptimizationInforeturnsNewInstances in class MethodOptimizationInfopublic void setReturnsExternalValues()
MethodOptimizationInfo.setNoExternalReturnValues() gets precedence.public boolean returnsExternalValues()
MethodOptimizationInforeturnsExternalValues in class MethodOptimizationInfopublic void generalizeReturnValue(proguard.evaluation.value.Value returnValue)
public void merge(MethodOptimizationInfo other)
public static void setProgramMethodOptimizationInfo(proguard.classfile.Clazz clazz,
proguard.classfile.Method method)
public static ProgramMethodOptimizationInfo getProgramMethodOptimizationInfo(proguard.classfile.Method method)