Package com.android.dx.ssa
Class Optimizer
java.lang.Object
com.android.dx.ssa.Optimizer
Runs a method through the SSA form conversion, any optimization algorithms,
and returns it to rop form.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SsaMethod
debugDeadCodeRemover
(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice) static SsaMethod
debugEdgeSplit
(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice) static SsaMethod
debugNoRegisterAllocation
(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice, EnumSet<Optimizer.OptionalStep> steps) static SsaMethod
debugPhiPlacement
(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice) static SsaMethod
debugRenaming
(RopMethod rmeth, int paramWidth, boolean isStatic, boolean inPreserveLocals, TranslationAdvice inAdvice) static TranslationAdvice
static boolean
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.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.
-
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
- 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 processparamWidth
- the total width, in register-units, of this method's parametersisStatic
- 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 insnsinAdvice
-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 processparamWidth
- the total width, in register-units, of this method's parametersisStatic
- 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 insnsinAdvice
-non-null;
translation advicesteps
- 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)
-