Class AbstractCOptimizer
java.lang.Object
com.pnfsoftware.jeb.core.AbstractPlugin
com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.AbstractOptimizer<ICMethod>
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt.AbstractCOptimizer
- All Implemented Interfaces:
IPlugin,ICOptimizer,IOptimizer<ICMethod>
- Direct Known Subclasses:
AbstractCBlockOptimizer
Base class for C AST optimizers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ICConstantFactoryConstant factory for the current method.protected ICElementFactoryElement factory for the current method.protected ICGlobalContextGlobal C AST context for the current method.protected ICMethodMethod currently being optimized.protected ICOperatorFactoryOperator factory for the current method.Fields inherited from class com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.AbstractOptimizer
loggerFields inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer
DEAD_CODE_REMOVER, DEOBFUSCATOR, PRIORITY_HIGH, PRIORITY_LOW, PRIORITY_STANDARD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the optional master optimizer that manages this optimizer.protected ICMasterOptimizerSafely retrieve a master optimizer.protected abstract intperform()Perform the optimizer-specific work.final intPerform the optimization pass.Methods inherited from class com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.AbstractOptimizer
addTag, getName, getPluginInformation, getPreferredExecutionStage, getPriority, getRequiredModeThreshold, getTags, getType, removeTag, setMasterOptimizer, setName, setPreferredExecutionStage, setPriority, setRequiredModeThreshold, setTypeMethods inherited from class com.pnfsoftware.jeb.core.AbstractPlugin
dispose, getData, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer
getPreferredExecutionStage, getPriority, getRequiredModeThreshold, getTags, getType, setMasterOptimizerMethods inherited from interface com.pnfsoftware.jeb.core.IPlugin
dispose, getData, getPluginInformation, setData
-
Field Details
-
m
Method currently being optimized. -
g
Global C AST context for the current method. -
ef
Element factory for the current method. -
of
Operator factory for the current method. -
cf
Constant factory for the current method.
-
-
Constructor Details
-
AbstractCOptimizer
public AbstractCOptimizer()Create a C AST optimizer.
-
-
Method Details
-
getMasterOptimizer
Description copied from interface:IOptimizerRetrieve the optional master optimizer that manages this optimizer.- Specified by:
getMasterOptimizerin interfaceIOptimizer<ICMethod>- Overrides:
getMasterOptimizerin classAbstractOptimizer<ICMethod>- Returns:
- optional reference
-
getMasterOptimizerSafe
Safely retrieve a master optimizer. IfgetMasterOptimizer()provides one, it is returned. Else, an empty immutable generic MO is provided.- Returns:
- never null
-
performOnTarget
Description copied from interface:IOptimizerPerform the optimization pass.- Specified by:
performOnTargetin interfaceIOptimizer<ICMethod>- Parameters:
m- target to optimize- Returns:
- the number of optimizations performed; if negative, an error has occurred and the optimizing process should be aborted
-
perform
protected abstract int perform()Perform the optimizer-specific work.- Returns:
- the number of optimizations performed
-