Class Optimizer

java.lang.Object
com.android.dx.ssa.Optimizer

public class Optimizer extends Object
Runs a method through the SSA form conversion, any optimization algorithms, and returns it to rop form.
  • Constructor Details

    • Optimizer

      public Optimizer()
  • Method Details

    • getPreserveLocals

      public static boolean getPreserveLocals()
      Returns:
      true if local variable information should be preserved, even at code size/register size cost
    • getAdvice

      public static TranslationAdvice getAdvice()
      Returns:
      non-null; translation advice
    • optimize

      public static RopMethod optimize(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice)
      Runs optimization algorthims over this method, and returns a new instance of RopMethod with the changes.
      Parameters:
      rmeth - method to process
      paramWidth - the total width, in register-units, of this method's parameters
      isStatic - true if this method has no 'this' pointer argument.
      inPreserveLocals - true if local variable info should be preserved, at the cost of some registers and insns
      inAdvice - non-null; translation advice
      Returns:
      optimized method
    • optimize

      public static RopMethod optimize(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice, EnumSet<Optimizer.OptionalStep> steps)
      Runs optimization algorthims over this method, and returns a new instance of RopMethod with the changes.
      Parameters:
      rmeth - method to process
      paramWidth - the total width, in register-units, of this method's parameters
      isStatic - true if this method has no 'this' pointer argument.
      inPreserveLocals - true if local variable info should be preserved, at the cost of some registers and insns
      inAdvice - non-null; translation advice
      steps - set of optional optimization steps to run
      Returns:
      optimized method
    • debugEdgeSplit

      public static SsaMethod debugEdgeSplit(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice)
    • debugPhiPlacement

      public static SsaMethod debugPhiPlacement(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice)
    • debugRenaming

      public static SsaMethod debugRenaming(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice)
    • debugDeadCodeRemover

      public static SsaMethod debugDeadCodeRemover(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice)
    • debugNoRegisterAllocation

      public static SsaMethod debugNoRegisterAllocation(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice, EnumSet<Optimizer.OptionalStep> steps)