public abstract class

AbstractEOptimizer

extends AbstractOptimizer<T>
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
Known Direct Subclasses

Summary

[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()
AbstractEOptimizer(DataChainsUpdatePolicy dataChainsUpdatePolicy)
AbstractEOptimizer(IERoutineContext ctx, DataChainsUpdatePolicy dataChainsUpdatePolicy)
AbstractEOptimizer(IERoutineContext ctx, DataChainsUpdatePolicy dataChainsUpdatePolicy, OptimizerType type)
Public Methods
DataChainsUpdatePolicy getDataChainsUpdatePolicy()
Get the data chains update policy after the optimization was performed.
abstract int perform(boolean updateDFA)
Perform the optimization pass.
int perform()
Same as perform(true).
IERoutineContext setTarget(IERoutineContext ectx)
Set the optimizer's target.
Protected Methods
int postPerform(boolean updateDFA, int totalOptimizationCount, boolean requestDFA)
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
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.opt.IOptimizer

Fields

protected CFG<IEStatement> cfg

protected IERoutineContext ectx

Public Constructors

public AbstractEOptimizer ()

public AbstractEOptimizer (DataChainsUpdatePolicy dataChainsUpdatePolicy)

public AbstractEOptimizer (IERoutineContext ctx, DataChainsUpdatePolicy dataChainsUpdatePolicy)

public AbstractEOptimizer (IERoutineContext ctx, DataChainsUpdatePolicy dataChainsUpdatePolicy, OptimizerType type)

Public Methods

public DataChainsUpdatePolicy getDataChainsUpdatePolicy ()

Get the data chains update policy after the optimization was performed.

public abstract int perform (boolean updateDFA)

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.

Note: in what scenario would you want when to use perform(false) ? one example is to optimize performances when chain-calling optimizers in a master optimizer for example. TODO: describe one scenario in detail.

Parameters
updateDFA if true, update data chains according to the optimizer's policy; if false, the optimizer should not perform final DFA computations if needed
Returns
  • the number of optimizations performed; if negative, an error has occurred and the optimizing process should be aborted

public int perform ()

Same as perform(true). Data chains will be updated according to the optimizer's DFA policy. Same as perform(true).

The above means that data chains after running this method may be modified, but must be in a consistent state with the CFG.

public IERoutineContext setTarget (IERoutineContext ectx)

Set the optimizer's target.

Protected Methods

protected int postPerform (boolean updateDFA, int totalOptimizationCount, boolean requestDFA)

protected int postPerform (boolean updateDFA, int totalOptimizationCount)

protected 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.