org.objectweb.asm.commons

Class AnalyzerAdapter

public class AnalyzerAdapter extends MethodAdapter

A MethodAdapter that keeps track of stack map frame changes between (int, int, Object[], int, Object[]) visitFrame calls. This adapter must be used with the EXPAND_FRAMES option. Each visitXXX instruction delegates to the next visitor in the chain, if any, and then simulates the effect of this instruction on the stack map frame, represented by locals and stack. The next visitor in the chain can get the state of the stack map frame before each instruction by reading the value of these fields in its visitXXX methods (this requires a reference to the AnalyzerAdapter that is before it in the chain).

Author: Eric Bruneton

Field Summary
Listlocals
List of the local variable slots for current execution frame.
Liststack
List of the operand stack slots for current execution frame.
Constructor Summary
AnalyzerAdapter(String owner, int access, String name, String desc, MethodVisitor mv)
Creates a new AnalyzerAdapter.
Method Summary
voidvisitFieldInsn(int opcode, String owner, String name, String desc)
voidvisitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack)
voidvisitIincInsn(int var, int increment)
voidvisitInsn(int opcode)
voidvisitIntInsn(int opcode, int operand)
voidvisitJumpInsn(int opcode, Label label)
voidvisitLabel(Label label)
voidvisitLdcInsn(Object cst)
voidvisitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels)
voidvisitMaxs(int maxStack, int maxLocals)
voidvisitMethodInsn(int opcode, String owner, String name, String desc)
voidvisitMultiANewArrayInsn(String desc, int dims)
voidvisitTableSwitchInsn(int min, int max, Label dflt, Label[] labels)
voidvisitTypeInsn(int opcode, String type)
voidvisitVarInsn(int opcode, int var)

Field Detail

locals

public List locals
List of the local variable slots for current execution frame. Primitive types are represented by TOP, INTEGER, FLOAT, LONG, DOUBLE,NULL or UNINITIALIZED_THIS (long and double are represented by a two elements, the second one being TOP). Reference types are represented by String objects (representing internal names), and uninitialized types by Label objects (this label designates the NEW instruction that created this uninitialized value). This field is null for unreacheable instructions.

stack

public List stack
List of the operand stack slots for current execution frame. Primitive types are represented by TOP, INTEGER, FLOAT, LONG, DOUBLE,NULL or UNINITIALIZED_THIS (long and double are represented by a two elements, the second one being TOP). Reference types are represented by String objects (representing internal names), and uninitialized types by Label objects (this label designates the NEW instruction that created this uninitialized value). This field is null for unreacheable instructions.

Constructor Detail

AnalyzerAdapter

public AnalyzerAdapter(String owner, int access, String name, String desc, MethodVisitor mv)
Creates a new AnalyzerAdapter.

Parameters: owner the owner's class name. access the method's access flags (see Opcodes). name the method's name. desc the method's descriptor (see Type). mv the method visitor to which this adapter delegates calls. May be null.

Method Detail

visitFieldInsn

public void visitFieldInsn(int opcode, String owner, String name, String desc)

visitFrame

public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack)

visitIincInsn

public void visitIincInsn(int var, int increment)

visitInsn

public void visitInsn(int opcode)

visitIntInsn

public void visitIntInsn(int opcode, int operand)

visitJumpInsn

public void visitJumpInsn(int opcode, Label label)

visitLabel

public void visitLabel(Label label)

visitLdcInsn

public void visitLdcInsn(Object cst)

visitLookupSwitchInsn

public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels)

visitMaxs

public void visitMaxs(int maxStack, int maxLocals)

visitMethodInsn

public void visitMethodInsn(int opcode, String owner, String name, String desc)

visitMultiANewArrayInsn

public void visitMultiANewArrayInsn(String desc, int dims)

visitTableSwitchInsn

public void visitTableSwitchInsn(int min, int max, Label dflt, Label[] labels)

visitTypeInsn

public void visitTypeInsn(int opcode, String type)

visitVarInsn

public void visitVarInsn(int opcode, int var)