public interface

IOptimizer

implements IPlugin
com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer<T>
Known Indirect Subclasses

Class Overview

Plugin interface for generic code optimizer. This interface is currently used to define IR and AST optimizers used by JEB Native Analysis Pipeline components. Optimizers are managed and invoked by a master-optimizer.

Summary

Constants
int PPA_NONE Signify no post-processing action.
int PPA_OPTIMIZATION_PASS_CLEANUP Post-processing action: run the clean-up optimizers registered with the MO only, eg dead-code removal.
int PPA_OPTIMIZATION_PASS_FULL Post-processing action: do a full optimization pass, per the current master optimizer managing this optimizer.
double PRIORITY_HIGH
double PRIORITY_LOW
double PRIORITY_STANDARD
Public Methods
abstract OptimizerClassId getClassId()
Retrieve the class id of this optimizer.
abstract double getDefaultPriority()
Get the optimizer default priority.
abstract IMasterOptimizer<T> getMasterOptimizer()
Retrieve the optional master optimizer that manages this optimizer.
abstract int getPostProcessingAction()
Get the action that should be executed after the optimizer was executed successfully and optimized code.
abstract int getPreferredExecutionStage()
This method is used for on-demand optimizers only.
abstract OptimizerMode getRequiredModeThreshold()
Specify the maximum master-optimizer threshold.
abstract OptimizerType getType()
Retrieve the type of this optimizer.
abstract int perform(T target)
Perform the optimization pass.
abstract void setMasterOptimizer(IMasterOptimizer<T> mo)
Set an optional master optimizer that manages this optimizer.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.IPlugin

Constants

public static final int PPA_NONE

Signify no post-processing action.

Constant Value: 0 (0x00000000)

public static final int PPA_OPTIMIZATION_PASS_CLEANUP

Post-processing action: run the clean-up optimizers registered with the MO only, eg dead-code removal.

Constant Value: 2 (0x00000002)

public static final int PPA_OPTIMIZATION_PASS_FULL

Post-processing action: do a full optimization pass, per the current master optimizer managing this optimizer.

Constant Value: 1 (0x00000001)

public static final double PRIORITY_HIGH

Constant Value: 10.0

public static final double PRIORITY_LOW

Constant Value: -10.0

public static final double PRIORITY_STANDARD

Constant Value: 0.0

Public Methods

public abstract OptimizerClassId getClassId ()

Retrieve the class id of this optimizer.

public abstract double getDefaultPriority ()

Get the optimizer default priority. Higher value means higher priority. Priorities are used by master optimizers to order optimizers.

Returns
  • the default priority

public abstract IMasterOptimizer<T> getMasterOptimizer ()

Retrieve the optional master optimizer that manages this optimizer.

Returns
  • optional reference

public abstract int getPostProcessingAction ()

Get the action that should be executed after the optimizer was executed successfully and optimized code. Post-processing actions may involve re-optimizing; if so, re-optimizations are not performed recursively, ie, post-processing actions will not trigger additional post-processing actions.

Returns
  • one of PPA_* constants; 0 means none

public abstract int getPreferredExecutionStage ()

This method is used for on-demand optimizers only.

public abstract OptimizerMode getRequiredModeThreshold ()

Specify the maximum master-optimizer threshold. Refer to AbstractMasterOptimizer for existing thresholds.

public abstract OptimizerType getType ()

Retrieve the type of this optimizer.

public abstract int perform (T target)

Perform the optimization pass.

Returns
  • the number of optimizations performed; if negative, an error has occurred and the optimizing process should be aborted

public abstract void setMasterOptimizer (IMasterOptimizer<T> mo)

Set an optional master optimizer that manages this optimizer.

Parameters
mo optional