Package net.bytebuddy.asm
Class Advice.Appender.EmulatingMethodVisitor
java.lang.Object
org.objectweb.asm.MethodVisitor
net.bytebuddy.asm.Advice.Appender.EmulatingMethodVisitor
- Enclosing class:
- Advice.Appender
protected static class Advice.Appender.EmulatingMethodVisitor
extends org.objectweb.asm.MethodVisitor
A method visitor that allows for the emulation of a full method visitor invocation circle without delegating initial
and ending visitations to the underlying visitor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteCodeAppender
The delegate byte code appender.private int
The currently recorded minimal required local variable array length.private int
The currently recorded minimal required stack size.Fields inherited from class org.objectweb.asm.MethodVisitor
api, mv
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
EmulatingMethodVisitor
(org.objectweb.asm.MethodVisitor methodVisitor, ByteCodeAppender delegate) Creates a new emulating method visitor. -
Method Summary
Modifier and TypeMethodDescriptionprotected ByteCodeAppender.Size
resolve
(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod) Resolves this this advice emulating method visitor for its delegate.void
void
visitEnd()
void
visitMaxs
(int stackSize, int localVariableLength) Methods inherited from class org.objectweb.asm.MethodVisitor
visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitParameter, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation, visitTypeInsn, visitVarInsn
-
Field Details
-
delegate
The delegate byte code appender. -
stackSize
private int stackSizeThe currently recorded minimal required stack size. -
localVariableLength
private int localVariableLengthThe currently recorded minimal required local variable array length.
-
-
Constructor Details
-
EmulatingMethodVisitor
protected EmulatingMethodVisitor(org.objectweb.asm.MethodVisitor methodVisitor, ByteCodeAppender delegate) Creates a new emulating method visitor.- Parameters:
methodVisitor
- The underlying method visitor.delegate
- The delegate byte code appender.
-
-
Method Details
-
resolve
protected ByteCodeAppender.Size resolve(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod) Resolves this this advice emulating method visitor for its delegate.- Parameters:
methodVisitor
- The method visitor to apply.implementationContext
- The implementation context to apply.instrumentedMethod
- The instrumented method.- Returns:
- The resulting size of the implemented method.
-
visitCode
public void visitCode()- Overrides:
visitCode
in classorg.objectweb.asm.MethodVisitor
-
visitMaxs
public void visitMaxs(int stackSize, int localVariableLength) - Overrides:
visitMaxs
in classorg.objectweb.asm.MethodVisitor
-
visitEnd
public void visitEnd()- Overrides:
visitEnd
in classorg.objectweb.asm.MethodVisitor
-