public class FullOptimizerContext extends Object implements OptimizerContext
Is updated incrementally.
NULL_OPTIMIZATION_CONTEXT
Constructor and Description |
---|
FullOptimizerContext(JProgram program) |
Modifier and Type | Method and Description |
---|---|
Set<JMethod> |
getCallees(Collection<JMethod> callerMethods)
Return callee methods of
callerMethods . |
Set<JMethod> |
getCallers(Collection<JMethod> calleeMethods)
Return caller methods of
calleeMethods . |
int |
getLastStepFor(String optimizerName)
Return the last modification step for a given optimizer.
|
Set<JMethod> |
getMethodsByReferencedFields(Collection<JField> fields)
Return methods that reference
fields . |
Set<JField> |
getModifiedFieldsSince(int stepSince)
Return all the effective modified fields since a given step.
|
Set<JMethod> |
getModifiedMethodsSince(int stepSince)
Return all the effective modified methods since a given step.
|
int |
getOptimizationStep()
Return the current optimization step number.
|
Set<JField> |
getReferencedFieldsByMethods(Collection<JMethod> methods)
Return fields that are referenced by
methods . |
Set<JMethod> |
getRemovedCalleeMethodsSince(int stepSince)
Get the removed callee methods since a given step.
|
void |
incOptimizationStep()
Increase the optimization step by 1, create a new set to record modifications in this step.
|
void |
markModified(JField modifiedField)
Add modified field to the modification information.
|
void |
markModified(JMethod modifiedMethod)
Add modified method to both the modification and dependence information.
|
void |
remove(JField field)
Remove field from the modification information.
|
void |
remove(JMethod method)
Remove method from both the dependence and modification information.
|
void |
removeFields(Collection<JField> fields)
Remove fields from the modification information.
|
void |
removeMethods(Collection<JMethod> methods)
Remove methods from the modification information.
|
void |
setLastStepFor(String optimizerName,
int step)
Set the last modification step of a given optimizer.
|
void |
syncDeletedSubCallGraphsSince(int step,
Collection<JMethod> prunedMethods)
Remove the pruned methods from the deleted sub call graphs since a given step.
|
void |
traverse(JVisitor visitor,
Set<? extends JNode> nodes)
Traverse the affected methods and fields.
|
public FullOptimizerContext(JProgram program)
public Set<JMethod> getCallees(Collection<JMethod> callerMethods)
OptimizerContext
callerMethods
.getCallees
in interface OptimizerContext
public Set<JMethod> getCallers(Collection<JMethod> calleeMethods)
OptimizerContext
calleeMethods
.getCallers
in interface OptimizerContext
public int getLastStepFor(String optimizerName)
OptimizerContext
getLastStepFor
in interface OptimizerContext
public Set<JMethod> getMethodsByReferencedFields(Collection<JField> fields)
OptimizerContext
fields
.getMethodsByReferencedFields
in interface OptimizerContext
public Set<JField> getModifiedFieldsSince(int stepSince)
OptimizerContext
getModifiedFieldsSince
in interface OptimizerContext
public Set<JMethod> getModifiedMethodsSince(int stepSince)
OptimizerContext
getModifiedMethodsSince
in interface OptimizerContext
public int getOptimizationStep()
OptimizerContext
getOptimizationStep
in interface OptimizerContext
public Set<JField> getReferencedFieldsByMethods(Collection<JMethod> methods)
OptimizerContext
methods
.getReferencedFieldsByMethods
in interface OptimizerContext
public Set<JMethod> getRemovedCalleeMethodsSince(int stepSince)
OptimizerContext
getRemovedCalleeMethodsSince
in interface OptimizerContext
public void incOptimizationStep()
OptimizerContext
incOptimizationStep
in interface OptimizerContext
public void markModified(JField modifiedField)
OptimizerContext
markModified
in interface OptimizerContext
public void markModified(JMethod modifiedMethod)
OptimizerContext
markModified
in interface OptimizerContext
public void remove(JField field)
OptimizerContext
remove
in interface OptimizerContext
public void remove(JMethod method)
OptimizerContext
remove
in interface OptimizerContext
public void removeFields(Collection<JField> fields)
OptimizerContext
removeFields
in interface OptimizerContext
public void removeMethods(Collection<JMethod> methods)
OptimizerContext
removeMethods
in interface OptimizerContext
public void setLastStepFor(String optimizerName, int step)
OptimizerContext
setLastStepFor
in interface OptimizerContext
public void syncDeletedSubCallGraphsSince(int step, Collection<JMethod> prunedMethods)
OptimizerContext
syncDeletedSubCallGraphsSince
in interface OptimizerContext
public void traverse(JVisitor visitor, Set<? extends JNode> nodes)
OptimizerContext
traverse
in interface OptimizerContext
Copyright © 2018. All rights reserved.