Package net.bytebuddy.asm
Class Advice.MethodSizeHandler.Default.ForAdvice
- java.lang.Object
-
- net.bytebuddy.asm.Advice.MethodSizeHandler.Default.ForAdvice
-
- All Implemented Interfaces:
Advice.MethodSizeHandler
,Advice.MethodSizeHandler.ForAdvice
- Enclosing class:
- Advice.MethodSizeHandler.Default
protected class Advice.MethodSizeHandler.Default.ForAdvice extends java.lang.Object implements Advice.MethodSizeHandler.ForAdvice
A method size handler for an advice method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.MethodSizeHandler
Advice.MethodSizeHandler.Default, Advice.MethodSizeHandler.ForAdvice, Advice.MethodSizeHandler.ForInstrumentedMethod, Advice.MethodSizeHandler.NoOp
-
-
Field Summary
Fields Modifier and Type Field Description private MethodDescription.InDefinedShape
adviceMethod
The advice method.private int
baseLocalVariableLength
The base of the local variable length that is implied by the method instrumentation prior to applying this advice method.private int
localVariableLengthPadding
The additional padding to apply to the local variable array.private int
stackSizePadding
The additional padding to apply to the operand stack.-
Fields inherited from interface net.bytebuddy.asm.Advice.MethodSizeHandler
UNDEFINED_SIZE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForAdvice(MethodDescription.InDefinedShape adviceMethod, int baseLocalVariableLength)
Creates a default method size handler for an advice method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
recordMaxima(int stackSize, int localVariableLength)
Records the maximum values for stack size and local variable array which are required by the advice method for its individual execution without translation.void
requireLocalVariableLength(int localVariableLength)
Requires a minimum length of the local variable array.void
requireLocalVariableLengthPadding(int localVariableLengthPadding)
Requires additional padding for the local variable array that is required for this advice's execution.void
requireStackSize(int stackSize)
Records a minimum stack size required by the represented advice method.void
requireStackSizePadding(int stackSizePadding)
Requires additional padding for the operand stack that is required for this advice's execution.
-
-
-
Field Detail
-
adviceMethod
private final MethodDescription.InDefinedShape adviceMethod
The advice method.
-
baseLocalVariableLength
private final int baseLocalVariableLength
The base of the local variable length that is implied by the method instrumentation prior to applying this advice method.
-
stackSizePadding
private int stackSizePadding
The additional padding to apply to the operand stack.
-
localVariableLengthPadding
private int localVariableLengthPadding
The additional padding to apply to the local variable array.
-
-
Constructor Detail
-
ForAdvice
protected ForAdvice(MethodDescription.InDefinedShape adviceMethod, int baseLocalVariableLength)
Creates a default method size handler for an advice method.- Parameters:
adviceMethod
- The advice method.baseLocalVariableLength
- The base of the local variable length that is implied by the method instrumentation prior to applying this advice method.
-
-
Method Detail
-
requireStackSize
public void requireStackSize(int stackSize)
Records a minimum stack size required by the represented advice method.- Specified by:
requireStackSize
in interfaceAdvice.MethodSizeHandler
- Parameters:
stackSize
- The minimum size required by the represented advice method.
-
requireLocalVariableLength
public void requireLocalVariableLength(int localVariableLength)
Requires a minimum length of the local variable array.- Specified by:
requireLocalVariableLength
in interfaceAdvice.MethodSizeHandler
- Parameters:
localVariableLength
- The minimal required length of the local variable array.
-
requireStackSizePadding
public void requireStackSizePadding(int stackSizePadding)
Requires additional padding for the operand stack that is required for this advice's execution.- Specified by:
requireStackSizePadding
in interfaceAdvice.MethodSizeHandler.ForAdvice
- Parameters:
stackSizePadding
- The required padding.
-
requireLocalVariableLengthPadding
public void requireLocalVariableLengthPadding(int localVariableLengthPadding)
Requires additional padding for the local variable array that is required for this advice's execution.- Specified by:
requireLocalVariableLengthPadding
in interfaceAdvice.MethodSizeHandler.ForAdvice
- Parameters:
localVariableLengthPadding
- The required padding.
-
recordMaxima
public void recordMaxima(int stackSize, int localVariableLength)
Records the maximum values for stack size and local variable array which are required by the advice method for its individual execution without translation.- Specified by:
recordMaxima
in interfaceAdvice.MethodSizeHandler.ForAdvice
- Parameters:
stackSize
- The minimum required stack size.localVariableLength
- The minimum required length of the local variable array.
-
-