Class LocalVariableAwareMethodVisitor

java.lang.Object
org.objectweb.asm.MethodVisitor
net.bytebuddy.utility.visitor.LocalVariableAwareMethodVisitor
Direct Known Subclasses:
MemberSubstitution.SubstitutingMethodVisitor

public class LocalVariableAwareMethodVisitor extends org.objectweb.asm.MethodVisitor
A method visitor that traces the amount of used local variable slots.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    The first offset that was observed to not be used.

    Fields inherited from class org.objectweb.asm.MethodVisitor

    api, mv
  • Constructor Summary

    Constructors
    Constructor
    Description
    LocalVariableAwareMethodVisitor(org.objectweb.asm.MethodVisitor methodVisitor, MethodDescription methodDescription)
    Creates a local variable aware method visitor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the first offset that was observed to be free.
    void
    visitVarInsn(int opcode, int offset)
     

    Methods inherited from class org.objectweb.asm.MethodVisitor

    visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitParameter, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation, visitTypeInsn

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • freeOffset

      private int freeOffset
      The first offset that was observed to not be used.
  • Constructor Details

    • LocalVariableAwareMethodVisitor

      public LocalVariableAwareMethodVisitor(org.objectweb.asm.MethodVisitor methodVisitor, MethodDescription methodDescription)
      Creates a local variable aware method visitor.
      Parameters:
      methodVisitor - The method visitor to delegate to.
      methodDescription - The method being visited.
  • Method Details

    • visitVarInsn

      public void visitVarInsn(int opcode, int offset)
      Overrides:
      visitVarInsn in class org.objectweb.asm.MethodVisitor
    • getFreeOffset

      public int getFreeOffset()
      Returns the first offset that was observed to be free.
      Returns:
      The first offset that was observed to be free.