protected abstract static class Advice.AdviceVisitor extends ExceptionTableSensitiveMethodVisitor implements Advice.Dispatcher.RelocationHandler.Relocation
Modifier and Type | Class and Description |
---|---|
protected static class |
Advice.AdviceVisitor.WithExitAdvice
An advice visitor that applies exit advice.
|
protected static class |
Advice.AdviceVisitor.WithoutExitAdvice
An advice visitor that does not apply exit advice.
|
Advice.Dispatcher.RelocationHandler.Relocation.ForLabel
Modifier and Type | Field and Description |
---|---|
protected Advice.ArgumentHandler.ForInstrumentedMethod |
argumentHandler
The handler for accessing arguments of the method's local variable array.
|
protected MethodDescription |
instrumentedMethod
A description of the instrumented method.
|
protected Advice.Dispatcher.Bound |
methodExit
The dispatcher to be used for method exit.
|
protected Advice.MethodSizeHandler.ForInstrumentedMethod |
methodSizeHandler
A handler for computing the method size requirements.
|
protected Advice.StackMapFrameHandler.ForInstrumentedMethod |
stackMapFrameHandler
A handler for translating and injecting stack map frames.
|
Modifier | Constructor and Description |
---|---|
protected |
AdviceVisitor(org.objectweb.asm.MethodVisitor methodVisitor,
Implementation.Context implementationContext,
Assigner assigner,
StackManipulation exceptionHandler,
TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
Advice.Dispatcher.Resolved.ForMethodEnter methodEnter,
Advice.Dispatcher.Resolved.ForMethodExit methodExit,
List<? extends TypeDescription> postMethodTypes,
int writerFlags,
int readerFlags)
Creates a new advice visitor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
onAfterExceptionTable()
Invoked after the exception table was visited.
|
protected abstract void |
onUserEnd()
Writes the advice for completing the instrumented method.
|
protected abstract void |
onUserPrepare()
Invoked when the user method's exception handler (if any) is supposed to be prepared.
|
protected abstract void |
onUserStart()
Writes the advice for entering the instrumented method.
|
void |
onVisitFrame(int type,
int localVariableLength,
Object[] localVariable,
int stackSize,
Object[] stack)
Visits a stack map frame.
|
protected void |
onVisitIincInsn(int offset,
int increment)
Visits an increment instruction.
|
protected void |
onVisitVarInsn(int opcode,
int offset)
Visits an variable instruction.
|
void |
visitLocalVariable(String name,
String descriptor,
String signature,
org.objectweb.asm.Label start,
org.objectweb.asm.Label end,
int index) |
org.objectweb.asm.AnnotationVisitor |
visitLocalVariableAnnotation(int typeReference,
org.objectweb.asm.TypePath typePath,
org.objectweb.asm.Label[] start,
org.objectweb.asm.Label[] end,
int[] index,
String descriptor,
boolean visible) |
void |
visitMaxs(int stackSize,
int localVariableLength) |
onVisitFieldInsn, onVisitInsn, onVisitIntInsn, onVisitInvokeDynamicInsn, onVisitJumpInsn, onVisitLabel, onVisitLdcInsn, onVisitLookupSwitchInsn, onVisitMethodInsn, onVisitMethodInsn, onVisitMultiANewArrayInsn, onVisitTableSwitchInsn, onVisitTypeInsn, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTypeInsn, visitVarInsn
visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitInsnAnnotation, visitLineNumber, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply
protected final MethodDescription instrumentedMethod
protected final Advice.Dispatcher.Bound methodExit
protected final Advice.ArgumentHandler.ForInstrumentedMethod argumentHandler
protected final Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler
protected final Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler
protected AdviceVisitor(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, StackManipulation exceptionHandler, TypeDescription instrumentedType, MethodDescription instrumentedMethod, Advice.Dispatcher.Resolved.ForMethodEnter methodEnter, Advice.Dispatcher.Resolved.ForMethodExit methodExit, List<? extends TypeDescription> postMethodTypes, int writerFlags, int readerFlags)
methodVisitor
- The actual method visitor that is underlying this method visitor to which all instructions are written.implementationContext
- The implementation context to use.assigner
- The assigner to use.exceptionHandler
- The stack manipulation to apply within a suppression handler.instrumentedType
- A description of the instrumented type.instrumentedMethod
- The instrumented method.methodEnter
- The method enter advice.methodExit
- The method exit advice.postMethodTypes
- A list of virtual method arguments that are available after the instrumented method has completed.writerFlags
- The ASM writer flags that were set.readerFlags
- The ASM reader flags that were set.protected void onAfterExceptionTable()
ExceptionTableSensitiveMethodVisitor
onAfterExceptionTable
in class ExceptionTableSensitiveMethodVisitor
protected abstract void onUserPrepare()
protected abstract void onUserStart()
protected void onVisitVarInsn(int opcode, int offset)
ExceptionTableSensitiveMethodVisitor
onVisitVarInsn
in class ExceptionTableSensitiveMethodVisitor
opcode
- The visited opcode.offset
- The visited offset.protected void onVisitIincInsn(int offset, int increment)
ExceptionTableSensitiveMethodVisitor
onVisitIincInsn
in class ExceptionTableSensitiveMethodVisitor
offset
- The offset of the accessed variable.increment
- The value with which to increment.public void onVisitFrame(int type, int localVariableLength, Object[] localVariable, int stackSize, Object[] stack)
ExceptionTableSensitiveMethodVisitor
onVisitFrame
in class ExceptionTableSensitiveMethodVisitor
type
- The type of stack map frame.localVariableLength
- The length of the local variable array.localVariable
- An array containing type symbols for all values in the local variable array.stackSize
- The size of the operand stack.stack
- An array containing type symbols for all values on the operand stack.public void visitMaxs(int stackSize, int localVariableLength)
visitMaxs
in class org.objectweb.asm.MethodVisitor
public void visitLocalVariable(String name, String descriptor, String signature, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int index)
visitLocalVariable
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitLocalVariableAnnotation(int typeReference, org.objectweb.asm.TypePath typePath, org.objectweb.asm.Label[] start, org.objectweb.asm.Label[] end, int[] index, String descriptor, boolean visible)
visitLocalVariableAnnotation
in class org.objectweb.asm.MethodVisitor
protected abstract void onUserEnd()
Copyright © 2014–2021. All rights reserved.