java.lang.Object | |||
↳ | com.pnfsoftware.jeb.core.AbstractPlugin | ||
↳ | com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.AbstractOptimizer<T> | ||
↳ | com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.AbstractEOptimizer |
![]() |
Base class for IR optimizers.
The no-arg constructor is for standard
optimizers, with DFA
updates handled internally
.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected CFG<IEStatement> | cfg | ||||||||||
protected IERoutineContext | ectx |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractEOptimizer()
Standard optimizer, DFA updates handled
internally . | |||||||||||
AbstractEOptimizer(DataChainsUpdatePolicy dataChainsUpdatePolicy)
Standard optimizer. | |||||||||||
AbstractEOptimizer(DataChainsUpdatePolicy dataChainsUpdatePolicy, OptimizerType type) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DataChainsUpdatePolicy |
getDataChainsUpdatePolicy()
Get the data chains update policy after the optimization was performed.
| ||||||||||
IEMasterOptimizer |
getMasterOptimizer()
Retrieve the optional master optimizer that manages this optimizer.
| ||||||||||
final int |
perform(IERoutineContext ctx)
Same as
perform(true) . | ||||||||||
IEGeneric |
performOnExpression(IEGeneric exp, IERoutineContext ectx)
Optimize a single expression.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | cleanCfg() | ||||||||||
void | debugVerifyCfg() | ||||||||||
boolean | deleteUnreachableTrampoline(BasicBlock<IEStatement> b) | ||||||||||
IEMasterOptimizer |
getMasterOptimizerSafe()
Safely retrieve a master optimizer.
| ||||||||||
abstract int |
perform(boolean updateDFA)
Perform the optimization pass.
| ||||||||||
final int | postPerform(boolean updateDFA, int totalOptimizationCount, boolean requestDFA) | ||||||||||
final int | postPerform(boolean updateDFA, int totalOptimizationCount) | ||||||||||
void |
setDataChainsUpdatePolicy(DataChainsUpdatePolicy dataChainsUpdatePolicy)
This method should rarely be called; data-chains update policy is set up in the constructor,
and should not change under normal circumstances.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Get the data chains update policy after the optimization was performed.
Retrieve the optional master optimizer that manages this optimizer.
Same as perform(true)
. Data chains will be updated according to the optimizer's DFA
policy.
The above means that data chains after running this method may be modified, but must be in a consistent state with the CFG.
Optimize a single expression. The default implementation does nothing and returns null.
exp | IR expression to optimize |
---|---|
ectx | helper routine context |
Safely retrieve a master optimizer. If getMasterOptimizer()
provides one, it is
returned. Else, an empty immutable generic MO is provided.
Perform the optimization pass. The caller may request that data chains not be updated, whenever possible. (They may be updated internally by the optimizer, which has the final say as to how and when DFA calculations should be run.)
The above means that data chains after running this method may or may not have been modified, and may or may not be in a consistent state with the optimized CFG.
updateDFA | must be true / this parameter will be deprecated (previously was: if true, update data chains according to the optimizer's policy; if false, the optimizer should not perform final DFA computations if needed) |
---|
postPerform(...)
or a negative number
indicating an error has occurred and the optimizing process should be aborted
This method should rarely be called; data-chains update policy is set up in the constructor, and should not change under normal circumstances.
dataChainsUpdatePolicy | null means DFA is handled internally, by the optimizer |
---|