Top Description Fields Constructors Methods
net.bytebuddy.utility.visitor

public Class LocalVariableAwareMethodVisitor

extends MethodVisitor
Class Inheritance
Known Direct Subclasses
net.bytebuddy.asm.MemberSubstitution.SubstitutingMethodVisitor
Imports
edu.umd.cs.findbugs.annotations.SuppressFBWarnings, net.bytebuddy.description.method.MethodDescription, net.bytebuddy.utility.OpenedClassReader, net.bytebuddy.jar.asm.MethodVisitor, .Opcodes

A method visitor that traces the amount of used local variable slots.

Field Summary

Modifier and TypeField and Description
private int
freeOffset

The first offset that was observed to not be used.

Inherited from net.bytebuddy.jar.asm.MethodVisitor:
apimv

Constructor Summary

AccessConstructor and Description
public
LocalVariableAwareMethodVisitor(MethodVisitor
The method visitor to delegate to.
methodVisitor
,
MethodDescription
The method being visited.
methodDescription
)

Creates a local variable aware method visitor.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The first offset that was observed to be free.
getFreeOffset
()

Returns the first offset that was observed to be free.

public void
visitVarInsn(int
the opcode of the local variable instruction to be visited. This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET.
opcode
,
int
the operand of the instruction to be visited. This operand is the index of a local variable.
offset
)

Overrides net.bytebuddy.jar.asm.MethodVisitor.visitVarInsn.

Visits a local variable instruction.
Inherited from net.bytebuddy.jar.asm.MethodVisitor:
getDelegatevisitAnnotableParameterCountvisitAnnotationvisitAnnotationDefaultvisitAttributevisitCodevisitEndvisitFieldInsnvisitFramevisitIincInsnvisitInsnvisitInsnAnnotationvisitIntInsnvisitInvokeDynamicInsnvisitJumpInsnvisitLabelvisitLdcInsnvisitLineNumbervisitLocalVariablevisitLocalVariableAnnotationvisitLookupSwitchInsnvisitMaxsvisitMethodInsnvisitMethodInsnvisitMultiANewArrayInsnvisitParametervisitParameterAnnotationvisitTableSwitchInsnvisitTryCatchAnnotationvisitTryCatchBlockvisitTypeAnnotationvisitTypeInsn

Field Detail

freeOffsetback to summary
private int freeOffset

The first offset that was observed to not be used.

Constructor Detail

LocalVariableAwareMethodVisitorback to summary
public LocalVariableAwareMethodVisitor(MethodVisitor methodVisitor, MethodDescription methodDescription)

Creates a local variable aware method visitor.

Parameters
methodVisitor:MethodVisitor

The method visitor to delegate to.

methodDescription:MethodDescription

The method being visited.

Method Detail

getFreeOffsetback to summary
public int getFreeOffset()

Returns the first offset that was observed to be free.

Returns:int

The first offset that was observed to be free.

visitVarInsnback to summary
public void visitVarInsn(int opcode, int offset)

Overrides net.bytebuddy.jar.asm.MethodVisitor.visitVarInsn.

Doc from net.bytebuddy.jar.asm.MethodVisitor.visitVarInsn.

Visits a local variable instruction. A local variable instruction is an instruction that loads or stores the value of a local variable.

Parameters
opcode:int

the opcode of the local variable instruction to be visited. This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET.

offset:int

the operand of the instruction to be visited. This operand is the index of a local variable.

Annotations
@Override
@SuppressFBWarnings:SF_SWITCH_NO_DEFAULT
justification:No action required on default option.