Class AbstractCBlockOptimizer
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
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt.AbstractCBlockOptimizer
- All Implemented Interfaces:
IPlugin,ICOptimizer,IOptimizer<ICMethod>
- Direct Known Subclasses:
AbstractCElementOptimizer,AbstractCStatementOptimizer
Perform a recursive optimizer on
ICBlock. The policy is recurse first, so optimizer is
done as post-treatment.-
Field Summary
Fields inherited from class com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt.AbstractCOptimizer
cf, ef, g, m, ofFields 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 TypeMethodDescriptionprotected ICStatementgetNextSiblingStatement(int statementIndex, ICBlock block, ICStatement blockNextSiblingStm) Retrieve the statement following a child block in its parent block.protected abstract intAttempt to optimize CBlock.protected intoptimizeBlock(ICBlock b, ICCompound parent, ICStatement blockNextStm) Attempt to optimize CBlock, with some contextual information provided.protected intperform()Can be overridden.final intRecursively process the method body blocks.Methods inherited from class com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt.AbstractCOptimizer
getMasterOptimizer, getMasterOptimizerSafe, performOnTargetMethods 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
-
Constructor Details
-
AbstractCBlockOptimizer
public AbstractCBlockOptimizer()Create a block optimizer.
-
-
Method Details
-
perform
protected int perform()Can be overridden. The default implementation simply callsperformOnMethoBlocksRecursivively().- Specified by:
performin classAbstractCOptimizer- Returns:
- the number of optimizations performed
-
performOnMethoBlocksRecursivively
public final int performOnMethoBlocksRecursivively()Recursively process the method body blocks.- Returns:
- the number of optimizations performed
-
getNextSiblingStatement
protected ICStatement getNextSiblingStatement(int statementIndex, ICBlock block, ICStatement blockNextSiblingStm) Retrieve the statement following a child block in its parent block.- Parameters:
statementIndex- index of the current statement inblockblock- block containing the current statementblockNextSiblingStm- next sibling statement ofblock, if any- Returns:
- the next sibling statement, or null if none exists
-
optimizeBlock
Attempt to optimize CBlock. Sub-expressions may be examined. The implementor should not attempt to modify parent or siblings CBlocks.- Parameters:
b- CBlock- Returns:
- the number of optimizations done
-
optimizeBlock
Attempt to optimize CBlock, with some contextual information provided. Sub-expressions may be examined. The implementor should not attempt to modify parent or siblings CBlocks.- Parameters:
b- CBlockparent- the parent compound statementblockNextStm- the next statement (i.e. the next sibling statement in the AST, not control-flow related)- Returns:
- the number of optimizations done
-