public class StackAwareMethodVisitor extends MethodVisitor
api, mv| Constructor and Description |
|---|
StackAwareMethodVisitor(MethodVisitor methodVisitor,
MethodDescription methodDescription)
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.
|
String |
toString() |
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) |
visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFrame, visitIincInsn, visitInsnAnnotation, visitLocalVariable, visitLocalVariableAnnotation, visitMaxs, visitMethodInsn, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTypeAnnotationpublic StackAwareMethodVisitor(MethodVisitor methodVisitor, MethodDescription methodDescription)
methodVisitor - The method visitor to delegate operations to.methodDescription - 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 MethodVisitorpublic void visitIntInsn(int opcode,
int operand)
visitIntInsn in class MethodVisitorpublic void visitVarInsn(int opcode,
int variable)
visitVarInsn in class MethodVisitorpublic void visitTypeInsn(int opcode,
String type)
visitTypeInsn in class MethodVisitorpublic void visitFieldInsn(int opcode,
String owner,
String name,
String descriptor)
visitFieldInsn in class MethodVisitorpublic void visitMethodInsn(int opcode,
String owner,
String name,
String descriptor,
boolean isInterface)
visitMethodInsn in class MethodVisitorpublic void visitInvokeDynamicInsn(String name, String descriptor, Handle bootstrap, Object... bootstrapArguments)
visitInvokeDynamicInsn in class MethodVisitorpublic void visitLdcInsn(Object value)
visitLdcInsn in class MethodVisitorpublic void visitMultiANewArrayInsn(String descriptor, int dimension)
visitMultiANewArrayInsn in class MethodVisitorpublic void visitJumpInsn(int opcode,
Label label)
visitJumpInsn in class MethodVisitorpublic void visitLabel(Label label)
visitLabel in class MethodVisitorpublic void visitLineNumber(int line,
Label start)
visitLineNumber in class MethodVisitorpublic void visitTableSwitchInsn(int minimum,
int maximum,
Label defaultOption,
Label... option)
visitTableSwitchInsn in class MethodVisitorpublic void visitLookupSwitchInsn(Label defaultOption, int[] key, Label[] option)
visitLookupSwitchInsn in class MethodVisitorpublic void visitTryCatchBlock(Label start, Label end, Label handler, String type)
visitTryCatchBlock in class MethodVisitorCopyright © 2014–2016. All rights reserved.