public class StackAwareMethodVisitor extends MethodVisitor
api, mv
Constructor and Description |
---|
StackAwareMethodVisitor(MethodVisitor methodVisitor,
MethodDescription instrumentedMethod)
Creates a new stack aware method visitor.
|
Modifier and Type | Method and Description |
---|---|
void |
drainStack()
Pops all values currently on the stack.
|
int |
drainStack(int store,
int load,
StackSize size)
Drains the stack to only contain the top value.
|
void |
register(Label label,
List<StackSize> stackSizes)
Explicitly registers a label to define a given stack state.
|
void |
visitFieldInsn(int opcode,
String owner,
String name,
String descriptor) |
void |
visitInsn(int opcode) |
void |
visitIntInsn(int opcode,
int operand) |
void |
visitInvokeDynamicInsn(String name,
String descriptor,
Handle bootstrap,
Object... bootstrapArguments) |
void |
visitJumpInsn(int opcode,
Label label) |
void |
visitLabel(Label label) |
void |
visitLdcInsn(Object value) |
void |
visitLineNumber(int line,
Label start) |
void |
visitLookupSwitchInsn(Label defaultOption,
int[] key,
Label[] option) |
void |
visitMethodInsn(int opcode,
String owner,
String name,
String descriptor,
boolean isInterface) |
void |
visitMultiANewArrayInsn(String descriptor,
int dimension) |
void |
visitTableSwitchInsn(int minimum,
int maximum,
Label defaultOption,
Label... option) |
void |
visitTryCatchBlock(Label start,
Label end,
Label handler,
String type) |
void |
visitTypeInsn(int opcode,
String type) |
void |
visitVarInsn(int opcode,
int variable) |
visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFrame, visitIincInsn, visitInsnAnnotation, visitLocalVariable, visitLocalVariableAnnotation, visitMaxs, visitMethodInsn, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTypeAnnotation
public StackAwareMethodVisitor(MethodVisitor methodVisitor, MethodDescription instrumentedMethod)
methodVisitor
- The method visitor to delegate operations to.instrumentedMethod
- The method description for which this method visitor is applied.public void drainStack()
public int drainStack(int store, int load, StackSize size)
store
- The opcode used for storing the top value.load
- The opcode used for loading the top value.size
- The size of the value on top of the operand stack.public void register(Label label, List<StackSize> stackSizes)
label
- The label to register a stack state for.stackSizes
- The stack sizes to assume when reaching the supplied label.public void visitInsn(int opcode)
visitInsn
in class MethodVisitor
public void visitIntInsn(int opcode, int operand)
visitIntInsn
in class MethodVisitor
public void visitVarInsn(int opcode, int variable)
visitVarInsn
in class MethodVisitor
public void visitTypeInsn(int opcode, String type)
visitTypeInsn
in class MethodVisitor
public void visitFieldInsn(int opcode, String owner, String name, String descriptor)
visitFieldInsn
in class MethodVisitor
public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface)
visitMethodInsn
in class MethodVisitor
public void visitInvokeDynamicInsn(String name, String descriptor, Handle bootstrap, Object... bootstrapArguments)
visitInvokeDynamicInsn
in class MethodVisitor
public void visitLdcInsn(Object value)
visitLdcInsn
in class MethodVisitor
public void visitMultiANewArrayInsn(String descriptor, int dimension)
visitMultiANewArrayInsn
in class MethodVisitor
public void visitJumpInsn(int opcode, Label label)
visitJumpInsn
in class MethodVisitor
public void visitLabel(Label label)
visitLabel
in class MethodVisitor
public void visitLineNumber(int line, Label start)
visitLineNumber
in class MethodVisitor
public void visitTableSwitchInsn(int minimum, int maximum, Label defaultOption, Label... option)
visitTableSwitchInsn
in class MethodVisitor
public void visitLookupSwitchInsn(Label defaultOption, int[] key, Label[] option)
visitLookupSwitchInsn
in class MethodVisitor
public void visitTryCatchBlock(Label start, Label end, Label handler, String type)
visitTryCatchBlock
in class MethodVisitor
Copyright © 2014–2020. All rights reserved.