org.dellroad.jc.cgen
Interface MethodOptimizer

All Known Implementing Classes:
DefaultMethodOptimizer

public interface MethodOptimizer

Interface for optimizing the Jimple code associated with a method. An implementation of this interface is assocated with each SootCodeGenerator.


Method Summary
 CompleteUnitGraph optimize(SootMethod method, Set deps)
          Optimize the given method's body.
 

Method Detail

optimize

public CompleteUnitGraph optimize(SootMethod method,
                                  Set deps)
Optimize the given method's body.

Depedencies should be added to deps when the class may not be explicitly referenced in the new body. For example, if a call to Arrays.sort() were inlined, then Arrays would need to be added as an explicit dependency, because the inlined code might not explicitly refer to the Arrays class.

Parameters:
method - method to optimize
deps - set to which to add any class file dependencies which may not be reflected in the byte code. To add a dependency, add the class' SootClass object.
Returns:
control flow graph of optimized method body