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.InDefinedShape |
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(MethodDescription.InDefinedShape 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 after a method's completion.
|
protected void |
injectFullFrame(MethodVisitor methodVisitor,
List<? extends TypeDescription> additionalTypes,
boolean exceptionOnStack)
Injects a full frame.
|
void |
injectHandlerFrame(MethodVisitor methodVisitor)
Injects a frame for a method's exception handler.
|
protected static Advice.StackMapFrameHandler.ForInstrumentedMethod |
of(MethodDescription.InDefinedShape 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.InDefinedShape methodDescription,
TypeList additionalTypes,
int frameType,
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.InDefinedShape instrumentedMethod
protected final TypeList requiredTypes
protected final TypeList yieldedTypes
protected Default(MethodDescription.InDefinedShape instrumentedMethod, TypeList requiredTypes, TypeList yieldedTypes, boolean expandFrames)
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(MethodDescription.InDefinedShape instrumentedMethod, List<? extends TypeDescription> requiredTypes, List<? extends TypeDescription> yieldedTypes, ClassFileVersion classFileVersion, int writerFlags, int readerFlags)
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.InDefinedShape methodDescription, TypeList additionalTypes, int frameType, 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.frameType
- 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 injectHandlerFrame(MethodVisitor methodVisitor)
Advice.StackMapFrameHandler
injectHandlerFrame
in interface Advice.StackMapFrameHandler
methodVisitor
- The method visitor to write the frame to.public void injectCompletionFrame(MethodVisitor methodVisitor, boolean secondary)
Advice.StackMapFrameHandler
injectCompletionFrame
in interface Advice.StackMapFrameHandler
methodVisitor
- The method visitor to write the frame to.secondary
- true
if the frame is written a second time.protected void injectFullFrame(MethodVisitor methodVisitor, List<? extends TypeDescription> additionalTypes, boolean exceptionOnStack)
methodVisitor
- The method visitor for which the frame should be written.additionalTypes
- The additional types that are considered to be part of the method's parameters.exceptionOnStack
- true
if there is a Throwable
on the operand stack.Copyright © 2014–2016. All rights reserved.