| java.lang.Object org.objectweb.asm.MethodAdapter org.objectweb.asm.commons.LocalVariablesSorter
All known Subclasses: org.objectweb.asm.commons.GeneratorAdapter,
LocalVariablesSorter | public class LocalVariablesSorter extends MethodAdapter (Code) | | A
MethodAdapter that renumbers local variables in their order of
appearance. This adapter allows one to easily add new local variables to a
method. It may be used by inheriting from this class, but the preferred way
of using it is via delegation: the next visitor in the chain can indeed add
new locals when needed by calling
LocalVariablesSorter.newLocal on this adapter (this
requires a reference back to this
LocalVariablesSorter ).
author: Chris Nokleberg author: Eugene Kuleshov author: Eric Bruneton |
Method Summary | |
public int | newLocal(Type type) Creates a new local variable of the given type.
Parameters: type - the type of the local variable to be created. | protected void | setLocalType(int local, Type type) Sets the current type of the given local variable. | public void | visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack) | public void | visitIincInsn(int var, int increment) | public void | visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) | public void | visitMaxs(int maxStack, int maxLocals) | public void | visitVarInsn(int opcode, int var) |
firstLocal | final protected int firstLocal(Code) | | Index of the first local variable, after formal parameters.
|
LocalVariablesSorter | public LocalVariablesSorter(int access, String desc, MethodVisitor mv)(Code) | | Creates a new
LocalVariablesSorter .
Parameters: access - access flags of the adapted method. Parameters: desc - the method's descriptor (see Type Type). Parameters: mv - the method visitor to which this adapter delegates calls. |
newLocal | public int newLocal(Type type)(Code) | | Creates a new local variable of the given type.
Parameters: type - the type of the local variable to be created. the identifier of the newly created local variable. |
setLocalType | protected void setLocalType(int local, Type type)(Code) | | Sets the current type of the given local variable. The default
implementation of this method does nothing.
Parameters: local - a local variable identifier, as returned by LocalVariablesSorter.newLocalnewLocal(). Parameters: type - the type of the value being stored in the local variable |
visitFrame | public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack)(Code) | | |
visitIincInsn | public void visitIincInsn(int var, int increment)(Code) | | |
visitMaxs | public void visitMaxs(int maxStack, int maxLocals)(Code) | | |
visitVarInsn | public void visitVarInsn(int opcode, int var)(Code) | | |
Methods inherited from org.objectweb.asm.MethodAdapter | public AnnotationVisitor visitAnnotation(String desc, boolean visible)(Code)(Java Doc) public AnnotationVisitor visitAnnotationDefault()(Code)(Java Doc) public void visitAttribute(Attribute attr)(Code)(Java Doc) public void visitCode()(Code)(Java Doc) public void visitEnd()(Code)(Java Doc) public void visitFieldInsn(int opcode, String owner, String name, String desc)(Code)(Java Doc) public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack)(Code)(Java Doc) public void visitIincInsn(int var, int increment)(Code)(Java Doc) public void visitInsn(int opcode)(Code)(Java Doc) public void visitIntInsn(int opcode, int operand)(Code)(Java Doc) public void visitJumpInsn(int opcode, Label label)(Code)(Java Doc) public void visitLabel(Label label)(Code)(Java Doc) public void visitLdcInsn(Object cst)(Code)(Java Doc) public void visitLineNumber(int line, Label start)(Code)(Java Doc) public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index)(Code)(Java Doc) public void visitLookupSwitchInsn(Label dflt, int keys, Label labels)(Code)(Java Doc) public void visitMaxs(int maxStack, int maxLocals)(Code)(Java Doc) public void visitMethodInsn(int opcode, String owner, String name, String desc)(Code)(Java Doc) public void visitMultiANewArrayInsn(String desc, int dims)(Code)(Java Doc) public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible)(Code)(Java Doc) public void visitTableSwitchInsn(int min, int max, Label dflt, Label labels)(Code)(Java Doc) public void visitTryCatchBlock(Label start, Label end, Label handler, String type)(Code)(Java Doc) public void visitTypeInsn(int opcode, String desc)(Code)(Java Doc) public void visitVarInsn(int opcode, int var)(Code)(Java Doc)
|
|
|