java.lang.Object | |||
↳ | com.pnfsoftware.jeb.core.AbstractPlugin | ||
↳ | com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.AbstractOptimizer<T extends com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizerTarget> | ||
↳ | com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.AbstractEOptimizer |
Known Direct Subclasses |
Base class for IR optimizers.
The no-arg constructor is for standard
optimizers, with DFA updates
handled internally
.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected CFG<IEStatement> | cfg | ||||||||||
protected IERoutineContext | ectx |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.AbstractOptimizer
|
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.
| ||||||||||
IEGeneric |
performOnExpression(IEGeneric exp, IERoutineContext ectx)
The default implementation does nothing and returns null.
| ||||||||||
final int |
performOnTarget(IERoutineContext ctx)
Same as
perform(true) . |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | cleanCfg() | ||||||||||
boolean | deleteUnreachableTrampoline(BasicBlock<IEStatement> b) | ||||||||||
void |
dumpCfg(String filename)
Dump the CFG.
| ||||||||||
IEMasterOptimizer |
getMasterOptimizerSafe()
Safely retrieve a master optimizer.
| ||||||||||
abstract int |
perform()
Perform the optimization pass.
| ||||||||||
final int |
postPerform(boolean updateDFA, int totalOptimizationCount, boolean requestDFA)
This method is deprecated.
This method is deprecated (the `updateDFA` parameter is now useless). Optimizers
should use
postPerform(int, boolean) instead.
| ||||||||||
final int |
postPerform(int totalOptimizationCount, boolean requestDFA)
Optimizers having
UPDATE_IF_OPTIMIZED or
UPDATE_IF_REQUIRED policy should return using this method. | ||||||||||
final int |
postPerform(boolean updateDFA, int totalOptimizationCount)
This method is deprecated.
This method is deprecated (the `updateDFA` parameter is now useless). Optimizers
should use
postPerform(int) instead.
| ||||||||||
final int |
postPerform(int totalOptimizationCount)
Optimizers having
UPDATE_IF_OPTIMIZED policy should return
using this method. | ||||||||||
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.
| ||||||||||
void |
verifyCfg()
Verify the CFG.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.AbstractOptimizer
| |||||||||||
From class
com.pnfsoftware.jeb.core.AbstractPlugin
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.pnfsoftware.jeb.core.IPlugin
| |||||||||||
From interface
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.IEOptimizer
| |||||||||||
From interface
com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer
|
Get the data chains update policy after the optimization was performed.
Retrieve the optional master optimizer that manages this optimizer.
The default implementation does nothing and returns null.
exp | IR expression to optimize |
---|---|
ectx | helper routine context |
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.
Dump the CFG. Convenience method calling dump(CFG, String)
.
filename | filename (the file will be created in the temp folder) |
---|
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.
postPerform(...)
or a negative number
indicating an error has occurred and the optimizing process should be aborted
This method is deprecated.
This method is deprecated (the `updateDFA` parameter is now useless). Optimizers
should use postPerform(int, boolean)
instead.
Optimizers having UPDATE_IF_OPTIMIZED
or
UPDATE_IF_REQUIRED
policy should return using this method.
totalOptimizationCount | count of optimizations |
---|
This method is deprecated.
This method is deprecated (the `updateDFA` parameter is now useless). Optimizers
should use postPerform(int)
instead.
Optimizers having UPDATE_IF_OPTIMIZED
policy should return
using this method.
totalOptimizationCount | count of optimizations |
---|
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 |
---|