public abstract class

AbstractOptimizer

extends AbstractPlugin
implements IOptimizer<T extends IOptimizerTarget>
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>
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Skeleton for a generic artifact optimizer.

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer
Fields
public static final ILogger logger Public logger accessible by the implementing optimizer.
Public Constructors
AbstractOptimizer()
AbstractOptimizer(T target)
Public Methods
IMasterOptimizer<T> getMasterOptimizer()
Retrieve the optional master optimizer that manages this optimizer.
String getName()
EditablePluginInformation getPluginInformation()
Retrieve basic information about the plugin, such as name, version, author, and organization.
int getPreferredExecutionStage()
This method is used for on-demand optimizers only.
final double getPriority()
The standard implementation provides a standard priority of 0.
OptimizerMode getRequiredModeThreshold()
Specify the minimum bar requested from the orchestrator in order to run.
Set<String> getTags()
Get the optimizer tags.
OptimizerType getType()
Retrieve the type of this optimizer.
void setMasterOptimizer(IMasterOptimizer<T> mo)
Set an optional master optimizer that manages this optimizer.
Protected Methods
void addTag(String tag)
void removeTag(String tag)
void setName(String name)
void setPreferredExecutionStage(int preferredExecStage)
Use only for type ON_DEMAND.
void setPriority(double priority)
Set the optimizer priority.
void setRequiredModeThreshold(OptimizerMode threshold)
Set the threshold.
void setType(OptimizerType type)
Set the type of optimizer.
[Expand]
Inherited Methods
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

public static final ILogger logger

Public logger accessible by the implementing optimizer. Writing to the logger should be favored over writing directly to stdout.

Public Constructors

public AbstractOptimizer ()

public AbstractOptimizer (T target)

Public Methods

public IMasterOptimizer<T> getMasterOptimizer ()

Retrieve the optional master optimizer that manages this optimizer.

Returns
  • optional reference

public String getName ()

public EditablePluginInformation getPluginInformation ()

Retrieve basic information about the plugin, such as name, version, author, and organization.

Returns
  • the plugin information

public int getPreferredExecutionStage ()

This method is used for on-demand optimizers only.

public final double getPriority ()

The standard implementation provides a standard priority of 0.

Returns
  • the optimizer priority

public OptimizerMode getRequiredModeThreshold ()

Specify the minimum bar requested from the orchestrator in order to run. If that bar is not met, the orchestrator should not run the optimizer. Refer to AbstractMasterOptimizer for existing thresholds.

public Set<String> getTags ()

Get the optimizer tags. An optimizer may have 0, 1, or more tags. A tag is a non-null, non-empty string.

Returns
  • a collection of tags; may be empty (tags are optional), but never null

public OptimizerType getType ()

Retrieve the type of this optimizer.

public void setMasterOptimizer (IMasterOptimizer<T> mo)

Set an optional master optimizer that manages this optimizer.

Parameters
mo optional

Protected Methods

protected void addTag (String tag)

protected void removeTag (String tag)

protected void setName (String name)

protected void setPreferredExecutionStage (int preferredExecStage)

Use only for type ON_DEMAND. Disregarded for other types. Leave to 0 for pure on-demand.

Parameters
preferredExecStage id such that abs(id) is in [1, 99] ; use positive value for post-stage execution, negative value for pre-stage execution

protected void setPriority (double priority)

Set the optimizer priority. To be used by the constructor.

Parameters
priority the new priority (high means higher priority). When optimizers are managed and run by an orchestrator, the optimizers with a higher priority are run before those having a lower priority. The default priority is 0.

protected void setRequiredModeThreshold (OptimizerMode threshold)

Set the threshold. The default value AbstractMasterOptimizer#MODE_NORMAL.

protected void setType (OptimizerType type)

Set the type of optimizer. The default is NORMAL. Optimizers with a type ON_DEMAND must also set their #setPreferredStage(int) preferred execution stage (else they will never run).