Class Inlining
java.lang.Object
net.covers1624.coffeegrinder.bytecode.transform.transformers.statement.Inlining
- All Implemented Interfaces:
StatementTransformer
Performs inlining transformations.
Created by coves1624 on 20/4/21.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanInlineIfRequired(Instruction expr, List<Runnable> extraInliningTasks, MethodTransformContext ctx) static <T> TmatchWithPotentialInline(@Nullable Instruction insn, List<Runnable> extraTransforms, MethodTransformContext ctx, Function<Instruction, @Nullable T> matcher) voidtransform(Instruction statement, StatementTransformContext ctx) Runs the transform on the statements within a block.
-
Constructor Details
-
Inlining
public Inlining()
-
-
Method Details
-
transform
Description copied from interface:StatementTransformerRuns the transform on the statements within a block.This transform may only modify instructions after and including the provided position. The transform will run from over the block backwards.
Instructions prior to the current position must not be modified. It is valid to read such instructions, but not recommended as those have not been transformed yet.
This function is only called on control-flow blocks with unreachable end-points. This, the last instruction in the block must always have the
InstructionFlag.END_POINT_UNREACHABLEflag.- Specified by:
transformin interfaceStatementTransformer- Parameters:
ctx- The context.
-
matchWithPotentialInline
@Nullable public static <T> T matchWithPotentialInline(@Nullable @Nullable Instruction insn, List<Runnable> extraTransforms, MethodTransformContext ctx, Function<Instruction, @Nullable T> matcher) -
canInlineIfRequired
public static boolean canInlineIfRequired(Instruction expr, List<Runnable> extraInliningTasks, MethodTransformContext ctx)
-