Class ConditionDetection
java.lang.Object
net.covers1624.coffeegrinder.bytecode.transform.transformers.ConditionDetection
- All Implemented Interfaces:
BlockTransformer,Transformer
Created by covers1624 on 25/5/21.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleaninlineExitBranch(Block block, BlockTransformContext ctx) Only inlines branches that are strictly dominated by this block (incoming edge count == 1)static voidinvertIf(IfInstruction ifInsn, MethodTransformContext ctx) Invert an IfInstruction.voidtransform(Block block, BlockTransformContext ctx) Runs the transform on the specified block.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.covers1624.coffeegrinder.bytecode.transform.Transformer
getName, stepType
-
Constructor Details
-
ConditionDetection
public ConditionDetection()
-
-
Method Details
-
transform
Description copied from interface:BlockTransformerRuns the transform on the specified block.- Specified by:
transformin interfaceBlockTransformer- Parameters:
block- The block to transform.ctx- Additional context provided to the transform.
-
inlineExitBranch
Only inlines branches that are strictly dominated by this block (incoming edge count == 1)...; br nextBlock; -> ...; { nextBlock... }- Parameters:
block- The block.- Returns:
- If the exit was inlined.
-
invertIf
Invert an IfInstruction. Assumes the IfInstruction does not have an else block.if (cond) { then... } else...; exit; -> if (!cond) { else...; exit } then...;- Parameters:
ifInsn- The IfInstruction.ctx- The transform context.
-