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 | |||
↳ | com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.AbstractEExpressionOptimizer |
Skeleton for a top-down, recursive, IEGeneric
optimizer. Expressions are provided in
depth-first, pre-order way: parent expressions are provided before their constituting children.
By default, IEStatement
s are not candidates for optimization (although they can be).
Generally, IEStatement
s should be optimized via the use an
AbstractEStatementOptimizer
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | AbstractEExpressionOptimizer.EOR | Optimized Expression |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected IEStatement | currentStatement | This field holds a reference to the top-level parent statement of the expression currently being optimized. | |||||||||
protected boolean | skipLeftSideOfAssignment | Do not process left-side of statement . |
|||||||||
protected boolean | skipStatementProcessing | Optimize only the constituents of the IRE statements, not the statements themselves. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.AbstractEOptimizer
| |||||||||||
From class
com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.AbstractOptimizer
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractEExpressionOptimizer(DataChainsUpdatePolicy dataChainsUpdatePolicy) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
IEGeneric |
performOnExpression(IEGeneric exp, IERoutineContext ectx)
The default implementation does nothing and returns null.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
IEGeneric |
doSubstitution(IEGeneric e, SubstitutionDefinition... substitutions)
Attempt to apply the first matching
SubstitutionDefinition on an IEGeneric
expression. | ||||||||||
abstract AbstractEExpressionOptimizer.EOR |
optimizeExpression(IEGeneric e)
Attempt to optimize expressions.
| ||||||||||
int |
perform()
Perform the optimization pass.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.AbstractEOptimizer
| |||||||||||
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
|
This field holds a reference to the top-level parent statement of the expression currently being optimized.
Optimize only the constituents of the IRE statements, not the statements themselves.
Default value: true.
dataChainsUpdatePolicy | expression optimizers should have a policy of
UPDATE_IF_OPTIMIZED or
UPDATE_IF_REQUIRED
|
---|
The default implementation does nothing and returns null.
exp | IR expression to optimize |
---|---|
ectx | helper routine context |
Attempt to apply the first matching SubstitutionDefinition
on an IEGeneric
expression.
e | the target expression to be matched and modified |
---|---|
substitutions | a list of candidate substitutions |
Attempt to optimize expressions. Sub-expressions may be examined. The implementor should not attempt to modify parent or cousins expressions.
e | IRE |
---|
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