Package net.bytebuddy.asm
Class MemberSubstitution.SubstitutingMethodVisitor
java.lang.Object
org.objectweb.asm.MethodVisitor
net.bytebuddy.utility.visitor.LocalVariableAwareMethodVisitor
net.bytebuddy.asm.MemberSubstitution.SubstitutingMethodVisitor
- Enclosing class:
MemberSubstitution
protected static class MemberSubstitution.SubstitutingMethodVisitor
extends LocalVariableAwareMethodVisitor
A method visitor that applies a substitution for matched methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classA method visitor that traces offsets of the local variable array being used. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Implementation.ContextThe implementation context to use.private final MethodDescriptionThe instrumented method.private final TypeDescriptionThe instrumented type.private intThe minimum amount of local variable array slots that are required to apply substitutions.private final MethodGraph.CompilerThe method graph compiler to use.private final MemberSubstitution.ReplacementThe replacement to use for creating substitutions.private intAn additional buffer for the operand stack that is required.private final booleantrueif the method processing should be strict where an exception is raised if a member cannot be found.private final TypePoolThe type pool to use.private final booleanIftrue, virtual method calls might target private methods in accordance to the nest mate specification.Fields inherited from class org.objectweb.asm.MethodVisitor
api, mv -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSubstitutingMethodVisitor(org.objectweb.asm.MethodVisitor methodVisitor, TypeDescription instrumentedType, MethodDescription instrumentedMethod, MethodGraph.Compiler methodGraphCompiler, boolean strict, MemberSubstitution.Replacement replacement, Implementation.Context implementationContext, TypePool typePool, boolean virtualPrivateCalls) Creates a new substituting method visitor. -
Method Summary
Modifier and TypeMethodDescriptionvoidvisitFieldInsn(int opcode, String owner, String internalName, String descriptor) voidvisitMaxs(int stackSize, int localVariableLength) voidvisitMethodInsn(int opcode, String owner, String internalName, String descriptor, boolean isInterface) Methods inherited from class net.bytebuddy.utility.visitor.LocalVariableAwareMethodVisitor
getFreeOffset, visitVarInsnMethods inherited from class org.objectweb.asm.MethodVisitor
getDelegate, visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFrame, visitIincInsn, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMethodInsn, visitMultiANewArrayInsn, visitParameter, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation, visitTypeInsn
-
Field Details
-
instrumentedType
The instrumented type. -
instrumentedMethod
The instrumented method. -
methodGraphCompiler
The method graph compiler to use. -
strict
private final boolean stricttrueif the method processing should be strict where an exception is raised if a member cannot be found. -
replacement
The replacement to use for creating substitutions. -
implementationContext
The implementation context to use. -
typePool
The type pool to use. -
virtualPrivateCalls
private final boolean virtualPrivateCallsIftrue, virtual method calls might target private methods in accordance to the nest mate specification. -
stackSizeBuffer
private int stackSizeBufferAn additional buffer for the operand stack that is required. -
localVariableExtension
private int localVariableExtensionThe minimum amount of local variable array slots that are required to apply substitutions.
-
-
Constructor Details
-
SubstitutingMethodVisitor
protected SubstitutingMethodVisitor(org.objectweb.asm.MethodVisitor methodVisitor, TypeDescription instrumentedType, MethodDescription instrumentedMethod, MethodGraph.Compiler methodGraphCompiler, boolean strict, MemberSubstitution.Replacement replacement, Implementation.Context implementationContext, TypePool typePool, boolean virtualPrivateCalls) Creates a new substituting method visitor.- Parameters:
methodVisitor- The method visitor to delegate to.instrumentedType- The instrumented type.instrumentedMethod- The instrumented method.methodGraphCompiler- The method graph compiler to use.strict-trueif the method processing should be strict where an exception is raised if a member cannot be found.replacement- The replacement to use for creating substitutions.implementationContext- The implementation context to use.typePool- The type pool to use.virtualPrivateCalls-true, virtual method calls might target private methods in accordance to the nest mate specification.
-
-
Method Details
-
visitFieldInsn
- Overrides:
visitFieldInsnin classorg.objectweb.asm.MethodVisitor
-
visitMethodInsn
public void visitMethodInsn(int opcode, String owner, String internalName, String descriptor, boolean isInterface) - Overrides:
visitMethodInsnin classorg.objectweb.asm.MethodVisitor
-
visitMaxs
public void visitMaxs(int stackSize, int localVariableLength) - Overrides:
visitMaxsin classorg.objectweb.asm.MethodVisitor
-