public abstract static class Advice.MethodSizeHandler.Default extends Object implements Advice.MethodSizeHandler.ForInstrumentedMethod
Modifier and Type | Class and Description |
---|---|
protected class |
Advice.MethodSizeHandler.Default.ForAdvice
A method size handler for an advice method.
|
protected static class |
Advice.MethodSizeHandler.Default.WithCopiedArguments
A method size handler that expects that the original arguments were copied.
|
protected static class |
Advice.MethodSizeHandler.Default.WithRetainedArguments
A method size handler that expects that the original arguments are retained.
|
Advice.MethodSizeHandler.Default, Advice.MethodSizeHandler.ForInstrumentedMethod, Advice.MethodSizeHandler.NoOp
Modifier and Type | Field and Description |
---|---|
protected List<? extends TypeDescription> |
enterTypes
A list of virtual method arguments that are available before the instrumented method is executed.
|
protected List<? extends TypeDescription> |
exitTypes
A list of virtual method arguments that are available after the instrumented method has completed.
|
protected MethodDescription |
instrumentedMethod
The instrumented method.
|
protected int |
localVariableLength
The maximum length of the local variable array required by a visited advice method.
|
protected int |
stackSize
The maximum stack size required by a visited advice method.
|
UNDEFINED_SIZE
Modifier | Constructor and Description |
---|---|
protected |
Default(MethodDescription instrumentedMethod,
List<? extends TypeDescription> enterTypes,
List<? extends TypeDescription> exitTypes)
Creates a new default meta data handler that recomputes the space requirements of an instrumented method.
|
Modifier and Type | Method and Description |
---|---|
Advice.MethodSizeHandler.ForAdvice |
bindEnter(MethodDescription.InDefinedShape adviceMethod)
Binds a method size handler for the enter advice.
|
Advice.MethodSizeHandler.ForAdvice |
bindExit(MethodDescription.InDefinedShape adviceMethod,
boolean skipThrowable)
Binds the method size handler for the exit advice.
|
int |
compoundLocalVariableLength(int localVariableLength)
Computes a compound local variable array length for the advice and the translated instrumented method.
|
int |
compoundStackSize(int stackSize)
Computes a compound stack size for the advice and the translated instrumented method.
|
protected static Advice.MethodSizeHandler.ForInstrumentedMethod |
of(MethodDescription instrumentedMethod,
List<? extends TypeDescription> enterTypes,
List<? extends TypeDescription> exitTypes,
boolean copyArguments,
int writerFlags)
Creates a method size handler applicable for the given instrumented method.
|
void |
requireLocalVariableLength(int localVariableLength)
Requires a minimum length of the local variable array.
|
void |
requireStackSize(int stackSize)
Records a minimum stack size required by the represented advice method.
|
protected final MethodDescription instrumentedMethod
protected final List<? extends TypeDescription> enterTypes
protected final List<? extends TypeDescription> exitTypes
protected int stackSize
protected int localVariableLength
protected Default(MethodDescription instrumentedMethod, List<? extends TypeDescription> enterTypes, List<? extends TypeDescription> exitTypes)
instrumentedMethod
- The instrumented method.enterTypes
- A list of virtual method arguments that are available before the instrumented method is executed.exitTypes
- A list of virtual method arguments that are available after the instrumented method has completed.protected static Advice.MethodSizeHandler.ForInstrumentedMethod of(MethodDescription instrumentedMethod, List<? extends TypeDescription> enterTypes, List<? extends TypeDescription> exitTypes, boolean copyArguments, int writerFlags)
instrumentedMethod
- The instrumented method.enterTypes
- A list of virtual method arguments that are available before the instrumented method is executed.exitTypes
- A list of virtual method arguments that are available after the instrumented method has completed.copyArguments
- true
if the original arguments are copied before invoking the instrumented method.writerFlags
- The flags supplied to the ASM class writer.public Advice.MethodSizeHandler.ForAdvice bindEnter(MethodDescription.InDefinedShape adviceMethod)
Advice.MethodSizeHandler.ForInstrumentedMethod
bindEnter
in interface Advice.MethodSizeHandler.ForInstrumentedMethod
adviceMethod
- The method representing the enter advice.public Advice.MethodSizeHandler.ForAdvice bindExit(MethodDescription.InDefinedShape adviceMethod, boolean skipThrowable)
Advice.MethodSizeHandler.ForInstrumentedMethod
bindExit
in interface Advice.MethodSizeHandler.ForInstrumentedMethod
adviceMethod
- The method representing the exit advice.skipThrowable
- true
if the exit advice is not invoked on an exception.public int compoundStackSize(int stackSize)
Advice.MethodSizeHandler.ForInstrumentedMethod
compoundStackSize
in interface Advice.MethodSizeHandler.ForInstrumentedMethod
stackSize
- The required stack size of the instrumented method before translation.public int compoundLocalVariableLength(int localVariableLength)
Advice.MethodSizeHandler.ForInstrumentedMethod
compoundLocalVariableLength
in interface Advice.MethodSizeHandler.ForInstrumentedMethod
localVariableLength
- The required local variable array length of the instrumented method before translation.public void requireStackSize(int stackSize)
Advice.MethodSizeHandler
requireStackSize
in interface Advice.MethodSizeHandler
stackSize
- The minimum size required by the represented advice method.public void requireLocalVariableLength(int localVariableLength)
Advice.MethodSizeHandler
requireLocalVariableLength
in interface Advice.MethodSizeHandler
localVariableLength
- The minimal required length of the local variable array.Copyright © 2014–2018. All rights reserved.