org.objectweb.asm.optimizer
类 MethodOptimizer
java.lang.Object
org.objectweb.asm.MethodAdapter
org.objectweb.asm.commons.LocalVariablesSorter
org.objectweb.asm.commons.RemappingMethodAdapter
org.objectweb.asm.optimizer.MethodOptimizer
- 所有已实现的接口:
- MethodVisitor
public class MethodOptimizer
- extends RemappingMethodAdapter
A MethodAdapter that renames fields and methods, and removes debug
info.
- 作者:
- Eugene Kuleshov
|
方法摘要 |
AnnotationVisitor |
visitAnnotationDefault()
Visits the default value of this annotation interface method. |
void |
visitAttribute(Attribute attr)
Visits a non standard attribute of this method. |
void |
visitFrame(int type,
int local,
Object[] local2,
int stack,
Object[] stack2)
Visits the current state of the local variables and operand stack
elements. |
void |
visitLineNumber(int line,
Label start)
Visits a line number declaration. |
void |
visitLocalVariable(String name,
String desc,
String signature,
Label start,
Label end,
int index)
Visits a local variable declaration. |
AnnotationVisitor |
visitParameterAnnotation(int parameter,
String desc,
boolean visible)
Visits an annotation of a parameter this method. |
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MethodOptimizer
public MethodOptimizer(int access,
String desc,
MethodVisitor mv,
Remapper remapper)
visitAnnotationDefault
public AnnotationVisitor visitAnnotationDefault()
- 从接口
MethodVisitor 复制的描述
- Visits the default value of this annotation interface method.
- 指定者:
- 接口
MethodVisitor 中的 visitAnnotationDefault - 覆盖:
- 类
RemappingMethodAdapter 中的 visitAnnotationDefault
- 返回:
- a visitor to the visit the actual default value of this
annotation interface method, or null if this visitor
is not interested in visiting this default value. The 'name'
parameters passed to the methods of this annotation visitor are
ignored. Moreover, exacly one visit method must be called on this
annotation visitor, followed by visitEnd.
visitParameterAnnotation
public AnnotationVisitor visitParameterAnnotation(int parameter,
String desc,
boolean visible)
- 从接口
MethodVisitor 复制的描述
- Visits an annotation of a parameter this method.
- 指定者:
- 接口
MethodVisitor 中的 visitParameterAnnotation - 覆盖:
- 类
RemappingMethodAdapter 中的 visitParameterAnnotation
- 参数:
parameter - the parameter index.desc - the class descriptor of the annotation class.visible - true if the annotation is visible at runtime.
- 返回:
- a visitor to visit the annotation values, or null if
this visitor is not interested in visiting this annotation.
visitLocalVariable
public void visitLocalVariable(String name,
String desc,
String signature,
Label start,
Label end,
int index)
- 从接口
MethodVisitor 复制的描述
- Visits a local variable declaration.
- 指定者:
- 接口
MethodVisitor 中的 visitLocalVariable - 覆盖:
- 类
RemappingMethodAdapter 中的 visitLocalVariable
- 参数:
name - the name of a local variable.desc - the type descriptor of this local variable.signature - the type signature of this local variable. May be
null if the local variable type does not use generic
types.start - the first instruction corresponding to the scope of this
local variable (inclusive).end - the last instruction corresponding to the scope of this local
variable (exclusive).index - the local variable's index.
visitLineNumber
public void visitLineNumber(int line,
Label start)
- 从接口
MethodVisitor 复制的描述
- Visits a line number declaration.
- 指定者:
- 接口
MethodVisitor 中的 visitLineNumber - 覆盖:
- 类
MethodAdapter 中的 visitLineNumber
- 参数:
line - a line number. This number refers to the source file from
which the class was compiled.start - the first instruction corresponding to this line number.
visitFrame
public void visitFrame(int type,
int local,
Object[] local2,
int stack,
Object[] stack2)
- 从接口
MethodVisitor 复制的描述
- Visits the current state of the local variables and operand stack
elements. This method must(*) be called just before any
instruction i that follows an unconditionnal branch instruction
such as GOTO or THROW, that is the target of a jump instruction, or that
starts an exception handler block. The visited types must describe the
values of the local variables and of the operand stack elements just
before i is executed.
(*) this is mandatory only
for classes whose version is greater than or equal to
V1_6.
Packed frames are basically
"deltas" from the state of the previous frame (very first frame is
implicitly defined by the method's parameters and access flags):
Opcodes.F_SAME representing frame with exactly the same
locals as the previous frame and with the empty stack. Opcodes.F_SAME1
representing frame with exactly the same locals as the previous frame and
with single value on the stack (nStack is 1 and
stack[0] contains value for the type of the stack item).
Opcodes.F_APPEND representing frame with current locals are
the same as the locals in the previous frame, except that additional
locals are defined (nLocal is 1, 2 or 3 and
local elements contains values representing added types).
Opcodes.F_CHOP representing frame with current locals are
the same as the locals in the previous frame, except that the last 1-3
locals are absent and with the empty stack (nLocals is 1,
2 or 3). Opcodes.F_FULL representing complete frame
data.
- 指定者:
- 接口
MethodVisitor 中的 visitFrame - 覆盖:
- 类
RemappingMethodAdapter 中的 visitFrame
- 参数:
type - the type of this stack map frame. Must be
Opcodes.F_NEW for expanded frames, or
Opcodes.F_FULL, Opcodes.F_APPEND,
Opcodes.F_CHOP, Opcodes.F_SAME or
Opcodes.F_APPEND, Opcodes.F_SAME1 for compressed
frames.local - the number of local variables in the visited frame.local2 - the local variable types in this frame. This array must not
be modified. Primitive types are represented by
Opcodes.TOP, Opcodes.INTEGER,
Opcodes.FLOAT, Opcodes.LONG,
Opcodes.DOUBLE,Opcodes.NULL or
Opcodes.UNINITIALIZED_THIS (long and double are
represented by a single element). 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).stack - the number of operand stack elements in the visited frame.stack2 - the operand stack types in this frame. This array must not
be modified. Its content has the same format as the "local" array.
visitAttribute
public void visitAttribute(Attribute attr)
- 从接口
MethodVisitor 复制的描述
- Visits a non standard attribute of this method.
- 指定者:
- 接口
MethodVisitor 中的 visitAttribute - 覆盖:
- 类
MethodAdapter 中的 visitAttribute
- 参数:
attr - an attribute.
Copyright © 2013. All Rights Reserved.