/***** Lobxxx Translate Finished ******/
/***
* ASM: a very small and fast Java bytecode manipulation framework
* Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.springframework.asm;
/**
* A {@link MethodVisitor} that generates methods in bytecode form. Each visit
* method of this class appends the bytecode corresponding to the visited
* instruction to a byte vector, in the order these methods are called.
*
* <p>
* 生成字节码形式的方法的{@link MethodVisitor}此类的每个访问方法都将对应于被访问指令的字节码追加到字节向量,这些方法称为
*
*
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
class MethodWriter extends MethodVisitor {
/**
* Pseudo access flag used to denote constructors.
* <p>
* 用于表示构造函数的伪访问标志
*
*/
static final int ACC_CONSTRUCTOR = 0x80000;
/**
* Frame has exactly the same locals as the previous stack map frame and
* number of stack items is zero.
* <p>
* 帧具有与先前堆栈映射帧完全相同的本地,并且堆栈项的数量为零
*
*/
static final int SAME_FRAME = 0; // to 63 (0-3f)
/**
* Frame has exactly the same locals as the previous stack map frame and
* number of stack items is 1
* <p>
* 帧具有与先前堆栈映射帧完全相同的本地,并且堆栈项的数量为1
*
*/
static final int SAME_LOCALS_1_STACK_ITEM_FRAME = 64; // to 127 (40-7f)
/**
* Reserved for future use
* <p>
* 留作将来使用
*
*/
static final int RESERVED = 128;
/**
* Frame has exactly the same locals as the previous stack map frame and
* number of stack items is 1. Offset is bigger then 63;
* <p>
* 帧具有与先前堆栈映射帧完全相同的本地,堆栈项的数量为1偏移大于63;
*
*/
static final int SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED = 247; // f7
/**
* Frame where current locals are the same as the locals in the previous
* frame, except that the k last locals are absent. The value of k is given
* by the formula 251-frame_type.
* <p>
* 除了k个最后一个本地不存在之外,当前本地人员与前一个帧中的本地人员相同的帧。k的值由公式251-frame_type
*
*/
static final int CHOP_FRAME = 248; // to 250 (f8-fA)
/**
* Frame has exactly the same locals as the previous stack map frame and
* number of stack items is zero. Offset is bigger then 63;
* <p>
* 帧具有与先前堆栈映射帧完全相同的本地,堆栈项的数量为零偏移大于63;
*
*/
static final int SAME_FRAME_EXTENDED = 251; // fb
/**
* Frame where current locals are the same as the locals in the previous
* frame, except that k additional locals are defined. The value of k is
* given by the formula frame_type-251.
* <p>
* 除了定义了k个额外的本地人之外,当前本地人物与前一帧中的本地人员相同的帧。k的值由公式frame_type-251
*
*/
static final int APPEND_FRAME = 252; // to 254 // fc-fe
/**
* Full frame
* <p>
* 全画幅
*
*/
static final int FULL_FRAME = 255; // ff
/**
* Indicates that the stack map frames must be recomputed from scratch. In
* this case the maximum stack size and number of local variables is also
* recomputed from scratch.
*
* <p>
* 表示堆栈映射帧必须从头重新计算在这种情况下,最大堆栈大小和局部变量的数量也从头重新计算
*
*
* @see #compute
*/
private static final int FRAMES = 0;
/**
* Indicates that the maximum stack size and number of local variables must
* be automatically computed.
*
* <p>
* 表示必须自动计算最大堆栈大小和局部变量的数量
*
*
* @see #compute
*/
private static final int MAXS = 1;
/**
* Indicates that nothing must be automatically computed.
*
* <p>
* 表示不能自动计算
*
*
* @see #compute
*/
private static final int NOTHING = 2;
/**
* The class writer to which this method must be added.
* <p>
* 必须添加此方法的类编写器
*
*/
final ClassWriter cw;
/**
* Access flags of this method.
* <p>
* 访问此方法的标志
*
*/
private int access;
/**
* The index of the constant pool item that contains the name of this
* method.
* <p>
* 包含此方法名称的常量池项目的索引
*
*/
private final int name;
/**
* The index of the constant pool item that contains the descriptor of this
* method.
* <p>
* 包含此方法描述符的常量池项的索引
*
*/
private final int desc;
/**
* The descriptor of this method.
* <p>
* 这个方法的描述符
*
*/
private final String descriptor;
/**
* The signature of this method.
* <p>
* 这种方法的签名
*
*/
String signature;
/**
* If not zero, indicates that the code of this method must be copied from
* the ClassReader associated to this writer in <code>cw.cr</code>. More
* precisely, this field gives the index of the first byte to copied from
* <code>cw.cr.b</code>.
* <p>
* 如果不为零,表示该方法的代码必须从<code> cwcr </code>中的与该写入器相关联的ClassReader复制。更确切地说,该字段给出了从<code> cwcrb < /代码>
*
*/
int classReaderOffset;
/**
* If not zero, indicates that the code of this method must be copied from
* the ClassReader associated to this writer in <code>cw.cr</code>. More
* precisely, this field gives the number of bytes to copied from
* <code>cw.cr.b</code>.
* <p>
* 如果不为零,则表示该方法的代码必须从<code> cwcr </code>中的与该写入程序相关联的ClassReader复制。
* 更准确地说,该字段给出从<code> cwcrb </code复制的字节数>。
*
*/
int classReaderLength;
/**
* Number of exceptions that can be thrown by this method.
* <p>
* 可以通过此方法抛出的异常数