public static class Advice.StackMapFrameHandler.Default extends Object implements Advice.StackMapFrameHandler.ForInstrumentedMethod
Modifier and Type | Class and Description |
---|---|
protected class |
Advice.StackMapFrameHandler.Default.ForAdvice
A stack map frame handler for an advice method.
|
protected static class |
Advice.StackMapFrameHandler.Default.TranslationMode
A translation mode that determines how the fixed frames of the instrumented method are written.
|
Advice.StackMapFrameHandler.Default, Advice.StackMapFrameHandler.ForInstrumentedMethod, Advice.StackMapFrameHandler.NoOp
Modifier and Type | Field and Description |
---|---|
protected MethodDescription |
instrumentedMethod
The instrumented method.
|
protected TypeList |
requiredTypes
A list of intermediate types to be considered as part of the instrumented method's steady signature.
|
protected TypeList |
yieldedTypes
The types that are expected to be added after the instrumented method returns.
|
Modifier | Constructor and Description |
---|---|
protected |
Default(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
TypeList requiredTypes,
TypeList yieldedTypes,
boolean expandFrames)
Creates a new default meta data handler.
|
Modifier and Type | Method and Description |
---|---|
Advice.StackMapFrameHandler.ForAdvice |
bindEntry(MethodDescription.InDefinedShape adviceMethod)
Binds this meta data handler for the entry advice.
|
Advice.StackMapFrameHandler.ForAdvice |
bindExit(MethodDescription.InDefinedShape adviceMethod)
Binds this meta data handler for the exit advice.
|
int |
getReaderHint()
Returns a hint to supply to a
ClassReader when parsing an advice method. |
void |
injectCompletionFrame(MethodVisitor methodVisitor,
boolean secondary)
Injects a frame indicating the completion of the currently handled method, i.e. all yielded types were added.
|
void |
injectExceptionFrame(MethodVisitor methodVisitor)
Injects a frame indicating the beginning of an exception handler for the currently handled method.
|
protected void |
injectFullFrame(MethodVisitor methodVisitor,
List<? extends TypeDescription> typesInArray,
List<? extends TypeDescription> typesOnStack)
Injects a full stack map frame.
|
void |
injectReturnFrame(MethodVisitor methodVisitor)
Injects a frame indicating the beginning of a return value handler for the currently handled method.
|
protected static Advice.StackMapFrameHandler.ForInstrumentedMethod |
of(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
List<? extends TypeDescription> requiredTypes,
List<? extends TypeDescription> yieldedTypes,
ClassFileVersion classFileVersion,
int writerFlags,
int readerFlags)
Creates an appropriate stack map frame handler for an instrumented method.
|
protected static Object |
toFrame(TypeDescription typeDescription)
Translates a type into a representation of its form inside a stack map frame.
|
String |
toString() |
protected void |
translateFrame(MethodVisitor methodVisitor,
Advice.StackMapFrameHandler.Default.TranslationMode translationMode,
MethodDescription methodDescription,
TypeList additionalTypes,
int type,
int localVariableLength,
Object[] localVariable,
int stackSize,
Object[] stack)
Translates a frame.
|
void |
translateFrame(MethodVisitor methodVisitor,
int type,
int localVariableLength,
Object[] localVariable,
int stackSize,
Object[] stack)
Translates a frame.
|
protected final MethodDescription instrumentedMethod
protected final TypeList requiredTypes
protected final TypeList yieldedTypes
protected Default(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypeList requiredTypes, TypeList yieldedTypes, boolean expandFrames)
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.requiredTypes
- A list of intermediate types to be considered as part of the instrumented method's steady signature.yieldedTypes
- The types that are expected to be added after the instrumented method returns.expandFrames
- true
if the meta data handler is expected to expand its frames.protected static Advice.StackMapFrameHandler.ForInstrumentedMethod of(TypeDescription instrumentedType, MethodDescription instrumentedMethod, List<? extends TypeDescription> requiredTypes, List<? extends TypeDescription> yieldedTypes, ClassFileVersion classFileVersion, int writerFlags, int readerFlags)
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.requiredTypes
- A list of intermediate types to be considered as part of the instrumented method's steady signature.yieldedTypes
- The types that are expected to be added after the instrumented method returns.classFileVersion
- The instrumented type's class file version.writerFlags
- The flags supplied to the ASM writier.readerFlags
- The reader flags supplied to the ASM reader.protected static Object toFrame(TypeDescription typeDescription)
typeDescription
- The type to translate.public Advice.StackMapFrameHandler.ForAdvice bindEntry(MethodDescription.InDefinedShape adviceMethod)
Advice.StackMapFrameHandler.ForInstrumentedMethod
bindEntry
in interface Advice.StackMapFrameHandler.ForInstrumentedMethod
adviceMethod
- The entry advice method.public Advice.StackMapFrameHandler.ForAdvice bindExit(MethodDescription.InDefinedShape adviceMethod)
Advice.StackMapFrameHandler.ForInstrumentedMethod
bindExit
in interface Advice.StackMapFrameHandler.ForInstrumentedMethod
adviceMethod
- The exit advice method.public int getReaderHint()
Advice.StackMapFrameHandler.ForInstrumentedMethod
ClassReader
when parsing an advice method.getReaderHint
in interface Advice.StackMapFrameHandler.ForInstrumentedMethod
public void translateFrame(MethodVisitor methodVisitor, int type, int localVariableLength, Object[] localVariable, int stackSize, Object[] stack)
Advice.StackMapFrameHandler
translateFrame
in interface Advice.StackMapFrameHandler
methodVisitor
- The method visitor to write the frame to.type
- The frame's type.localVariableLength
- The local variable length.localVariable
- An array containing the types of the current local variables.stackSize
- The size of the operand stack.stack
- An array containing the types of the current operand stack.protected void translateFrame(MethodVisitor methodVisitor, Advice.StackMapFrameHandler.Default.TranslationMode translationMode, MethodDescription methodDescription, TypeList additionalTypes, int type, int localVariableLength, Object[] localVariable, int stackSize, Object[] stack)
methodVisitor
- The method visitor to write the frame to.translationMode
- The translation mode to apply.methodDescription
- The method description for which the frame is written.additionalTypes
- The additional types to consider part of the instrumented method's parameters.type
- The frame's type.localVariableLength
- The local variable length.localVariable
- An array containing the types of the current local variables.stackSize
- The size of the operand stack.stack
- An array containing the types of the current operand stack.public void injectReturnFrame(MethodVisitor methodVisitor)
Advice.StackMapFrameHandler
injectReturnFrame
in interface Advice.StackMapFrameHandler
methodVisitor
- The method visitor onto which to apply the stack map frame.public void injectExceptionFrame(MethodVisitor methodVisitor)
Advice.StackMapFrameHandler
injectExceptionFrame
in interface Advice.StackMapFrameHandler
methodVisitor
- The method visitor onto which to apply the stack map frame.public void injectCompletionFrame(MethodVisitor methodVisitor, boolean secondary)
Advice.StackMapFrameHandler
injectCompletionFrame
in interface Advice.StackMapFrameHandler
methodVisitor
- The method visitor onto which to apply the stack map frame.secondary
- true
if another completion frame for this method was written previously.protected void injectFullFrame(MethodVisitor methodVisitor, List<? extends TypeDescription> typesInArray, List<? extends TypeDescription> typesOnStack)
methodVisitor
- The method visitor onto which to write the stack map frame.typesInArray
- The types that were added to the local variable array additionally to the values of the instrumented method.typesOnStack
- The types currently on the operand stack.Copyright © 2014–2016. All rights reserved.