类 ConstantInstruction
- java.lang.Object
-
- proguard.classfile.instruction.Instruction
-
- proguard.classfile.instruction.ConstantInstruction
-
- 所有已实现的接口:
ConstantVisitor
public class ConstantInstruction extends Instruction implements ConstantVisitor
ThisInstructionrepresents an instruction that refers to an entry in the constant pool.
-
-
字段概要
字段 修饰符和类型 字段 说明 intconstantintconstantIndex-
从类继承的字段 proguard.classfile.instruction.Instruction
ARRAY_T_BOOLEAN, ARRAY_T_BYTE, ARRAY_T_CHAR, ARRAY_T_DOUBLE, ARRAY_T_FLOAT, ARRAY_T_INT, ARRAY_T_LONG, ARRAY_T_SHORT, NAMES, OP_AALOAD, OP_AASTORE, OP_ACONST_NULL, OP_ALOAD, OP_ALOAD_0, OP_ALOAD_1, OP_ALOAD_2, OP_ALOAD_3, OP_ANEWARRAY, OP_ARETURN, OP_ARRAYLENGTH, OP_ASTORE, OP_ASTORE_0, OP_ASTORE_1, OP_ASTORE_2, OP_ASTORE_3, OP_ATHROW, OP_BALOAD, OP_BASTORE, OP_BIPUSH, OP_CALOAD, OP_CASTORE, OP_CHECKCAST, OP_D2F, OP_D2I, OP_D2L, OP_DADD, OP_DALOAD, OP_DASTORE, OP_DCMPG, OP_DCMPL, OP_DCONST_0, OP_DCONST_1, OP_DDIV, OP_DLOAD, OP_DLOAD_0, OP_DLOAD_1, OP_DLOAD_2, OP_DLOAD_3, OP_DMUL, OP_DNEG, OP_DREM, OP_DRETURN, OP_DSTORE, OP_DSTORE_0, OP_DSTORE_1, OP_DSTORE_2, OP_DSTORE_3, OP_DSUB, OP_DUP, OP_DUP_X1, OP_DUP_X2, OP_DUP2, OP_DUP2_X1, OP_DUP2_X2, OP_F2D, OP_F2I, OP_F2L, OP_FADD, OP_FALOAD, OP_FASTORE, OP_FCMPG, OP_FCMPL, OP_FCONST_0, OP_FCONST_1, OP_FCONST_2, OP_FDIV, OP_FLOAD, OP_FLOAD_0, OP_FLOAD_1, OP_FLOAD_2, OP_FLOAD_3, OP_FMUL, OP_FNEG, OP_FREM, OP_FRETURN, OP_FSTORE, OP_FSTORE_0, OP_FSTORE_1, OP_FSTORE_2, OP_FSTORE_3, OP_FSUB, OP_GETFIELD, OP_GETSTATIC, OP_GOTO, OP_GOTO_W, OP_I2B, OP_I2C, OP_I2D, OP_I2F, OP_I2L, OP_I2S, OP_IADD, OP_IALOAD, OP_IAND, OP_IASTORE, OP_ICONST_0, OP_ICONST_1, OP_ICONST_2, OP_ICONST_3, OP_ICONST_4, OP_ICONST_5, OP_ICONST_M1, OP_IDIV, OP_IFACMPEQ, OP_IFACMPNE, OP_IFEQ, OP_IFGE, OP_IFGT, OP_IFICMPEQ, OP_IFICMPGE, OP_IFICMPGT, OP_IFICMPLE, OP_IFICMPLT, OP_IFICMPNE, OP_IFLE, OP_IFLT, OP_IFNE, OP_IFNONNULL, OP_IFNULL, OP_IINC, OP_ILOAD, OP_ILOAD_0, OP_ILOAD_1, OP_ILOAD_2, OP_ILOAD_3, OP_IMUL, OP_INEG, OP_INSTANCEOF, OP_INVOKEDYNAMIC, OP_INVOKEINTERFACE, OP_INVOKESPECIAL, OP_INVOKESTATIC, OP_INVOKEVIRTUAL, OP_IOR, OP_IREM, OP_IRETURN, OP_ISHL, OP_ISHR, OP_ISTORE, OP_ISTORE_0, OP_ISTORE_1, OP_ISTORE_2, OP_ISTORE_3, OP_ISUB, OP_IUSHR, OP_IXOR, OP_JSR, OP_JSR_W, OP_L2D, OP_L2F, OP_L2I, OP_LADD, OP_LALOAD, OP_LAND, OP_LASTORE, OP_LCMP, OP_LCONST_0, OP_LCONST_1, OP_LDC, OP_LDC_W, OP_LDC2_W, OP_LDIV, OP_LLOAD, OP_LLOAD_0, OP_LLOAD_1, OP_LLOAD_2, OP_LLOAD_3, OP_LMUL, OP_LNEG, OP_LOOKUPSWITCH, OP_LOR, OP_LREM, OP_LRETURN, OP_LSHL, OP_LSHR, OP_LSTORE, OP_LSTORE_0, OP_LSTORE_1, OP_LSTORE_2, OP_LSTORE_3, OP_LSUB, OP_LUSHR, OP_LXOR, OP_MONITORENTER, OP_MONITOREXIT, OP_MULTIANEWARRAY, OP_NEW, OP_NEWARRAY, OP_NOP, OP_POP, OP_POP2, OP_PUTFIELD, OP_PUTSTATIC, OP_RET, OP_RETURN, OP_SALOAD, OP_SASTORE, OP_SIPUSH, OP_SWAP, OP_TABLESWITCH, OP_WIDE, opcode
-
-
构造器概要
构造器 构造器 说明 ConstantInstruction()Creates an uninitialized ConstantInstruction.ConstantInstruction(byte opcode, int constantIndex)Creates a new ConstantInstruction with the given opcode and constant pool index.ConstantInstruction(byte opcode, int constantIndex, int constant)Creates a new ConstantInstruction with the given opcode, constant pool index, and constant.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaccept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, InstructionVisitor instructionVisitor)Accepts the given visitor.bytecanonicalOpcode()Returns the canonical opcode of this instruction, i.e. typically the opcode whose extension has been removed.ConstantInstructioncopy(ConstantInstruction constantInstruction)Copies the given instruction into this instruction.booleanequals(java.lang.Object o)inthashCode()intlength(int offset)Returns the length in bytes of the instruction.booleanmayInstanceThrowExceptions(Clazz clazz)Returns whether a particular instance of an instruction may throw an exception.protected voidreadInfo(byte[] code, int offset)Reads the data following the instruction opcode.Instructionshrink()Shrinks this instruction to its shortest possible form.intstackPopCount(Clazz clazz)Returns the number of entries popped from the stack during the execution of the instruction.intstackPushCount(Clazz clazz)Returns the number of entries pushed onto the stack during the execution of the instruction.java.lang.StringtoString()java.lang.StringtoString(Clazz clazz, int offset)Returns a description of the instruction, at the given offset.voidvisitClassConstant(Clazz clazz, ClassConstant classConstant)voidvisitDoubleConstant(Clazz clazz, DoubleConstant doubleConstant)voidvisitDynamicConstant(Clazz clazz, DynamicConstant dynamicConstant)voidvisitFieldrefConstant(Clazz clazz, FieldrefConstant fieldrefConstant)voidvisitFloatConstant(Clazz clazz, FloatConstant floatConstant)voidvisitIntegerConstant(Clazz clazz, IntegerConstant integerConstant)voidvisitInterfaceMethodrefConstant(Clazz clazz, InterfaceMethodrefConstant interfaceMethodrefConstant)voidvisitInvokeDynamicConstant(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant)voidvisitLongConstant(Clazz clazz, LongConstant longConstant)voidvisitMethodHandleConstant(Clazz clazz, MethodHandleConstant methodHandleConstant)voidvisitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant)voidvisitMethodTypeConstant(Clazz clazz, MethodTypeConstant methodTypeConstant)voidvisitModuleConstant(Clazz clazz, ModuleConstant moduleConstant)voidvisitNameAndTypeConstant(Clazz clazz, NameAndTypeConstant nameAndTypeConstant)voidvisitPackageConstant(Clazz clazz, PackageConstant packageConstant)voidvisitPrimitiveArrayConstant(Clazz clazz, PrimitiveArrayConstant primitiveArrayConstant)voidvisitStringConstant(Clazz clazz, StringConstant stringConstant)voidvisitUtf8Constant(Clazz clazz, Utf8Constant utf8Constant)protected voidwriteInfo(byte[] code, int offset)Writes data following the instruction opcode.-
从类继承的方法 proguard.classfile.instruction.Instruction
actualOpcode, getName, isCategory2, isWide, mayThrowExceptions, readByte, readInt, readShort, readSignedByte, readSignedShort, readSignedValue, readValue, stackEntryIndexBefore, toString, write, write, writeByte, writeInt, writeShort, writeSignedByte, writeSignedShort, writeSignedValue, writeValue
-
从接口继承的方法 proguard.classfile.constant.visitor.ConstantVisitor
visitAnyConstant, visitAnyMethodrefConstant, visitAnyRefConstant
-
-
-
-
构造器详细资料
-
ConstantInstruction
public ConstantInstruction()
Creates an uninitialized ConstantInstruction.
-
ConstantInstruction
public ConstantInstruction(byte opcode, int constantIndex)Creates a new ConstantInstruction with the given opcode and constant pool index.
-
ConstantInstruction
public ConstantInstruction(byte opcode, int constantIndex, int constant)Creates a new ConstantInstruction with the given opcode, constant pool index, and constant.
-
-
方法详细资料
-
copy
public ConstantInstruction copy(ConstantInstruction constantInstruction)
Copies the given instruction into this instruction.- 参数:
constantInstruction- the instruction to be copied.- 返回:
- this instruction.
-
mayInstanceThrowExceptions
public boolean mayInstanceThrowExceptions(Clazz clazz)
Returns whether a particular instance of an instruction may throw an exception.In particular, this takes into account that an ldc with a class, method type or method ref constant operand may throw exceptions while other constants may not.
-
canonicalOpcode
public byte canonicalOpcode()
从类复制的说明:InstructionReturns the canonical opcode of this instruction, i.e. typically the opcode whose extension has been removed.- 覆盖:
canonicalOpcode在类中Instruction
-
shrink
public Instruction shrink()
从类复制的说明:InstructionShrinks this instruction to its shortest possible form.- 指定者:
shrink在类中Instruction- 返回:
- this instruction.
-
readInfo
protected void readInfo(byte[] code, int offset)从类复制的说明:InstructionReads the data following the instruction opcode.- 指定者:
readInfo在类中Instruction
-
writeInfo
protected void writeInfo(byte[] code, int offset)从类复制的说明:InstructionWrites data following the instruction opcode.- 指定者:
writeInfo在类中Instruction
-
length
public int length(int offset)
从类复制的说明:InstructionReturns the length in bytes of the instruction.- 指定者:
length在类中Instruction
-
accept
public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, InstructionVisitor instructionVisitor)
从类复制的说明:InstructionAccepts the given visitor.- 指定者:
accept在类中Instruction
-
toString
public java.lang.String toString(Clazz clazz, int offset)
从类复制的说明:InstructionReturns a description of the instruction, at the given offset.- 覆盖:
toString在类中Instruction
-
stackPopCount
public int stackPopCount(Clazz clazz)
从类复制的说明:InstructionReturns the number of entries popped from the stack during the execution of the instruction.- 覆盖:
stackPopCount在类中Instruction
-
stackPushCount
public int stackPushCount(Clazz clazz)
从类复制的说明:InstructionReturns the number of entries pushed onto the stack during the execution of the instruction.- 覆盖:
stackPushCount在类中Instruction
-
visitIntegerConstant
public void visitIntegerConstant(Clazz clazz, IntegerConstant integerConstant)
- 指定者:
visitIntegerConstant在接口中ConstantVisitor
-
visitLongConstant
public void visitLongConstant(Clazz clazz, LongConstant longConstant)
- 指定者:
visitLongConstant在接口中ConstantVisitor
-
visitFloatConstant
public void visitFloatConstant(Clazz clazz, FloatConstant floatConstant)
- 指定者:
visitFloatConstant在接口中ConstantVisitor
-
visitDoubleConstant
public void visitDoubleConstant(Clazz clazz, DoubleConstant doubleConstant)
- 指定者:
visitDoubleConstant在接口中ConstantVisitor
-
visitPrimitiveArrayConstant
public void visitPrimitiveArrayConstant(Clazz clazz, PrimitiveArrayConstant primitiveArrayConstant)
- 指定者:
visitPrimitiveArrayConstant在接口中ConstantVisitor
-
visitStringConstant
public void visitStringConstant(Clazz clazz, StringConstant stringConstant)
- 指定者:
visitStringConstant在接口中ConstantVisitor
-
visitUtf8Constant
public void visitUtf8Constant(Clazz clazz, Utf8Constant utf8Constant)
- 指定者:
visitUtf8Constant在接口中ConstantVisitor
-
visitMethodHandleConstant
public void visitMethodHandleConstant(Clazz clazz, MethodHandleConstant methodHandleConstant)
- 指定者:
visitMethodHandleConstant在接口中ConstantVisitor
-
visitClassConstant
public void visitClassConstant(Clazz clazz, ClassConstant classConstant)
- 指定者:
visitClassConstant在接口中ConstantVisitor
-
visitMethodTypeConstant
public void visitMethodTypeConstant(Clazz clazz, MethodTypeConstant methodTypeConstant)
- 指定者:
visitMethodTypeConstant在接口中ConstantVisitor
-
visitModuleConstant
public void visitModuleConstant(Clazz clazz, ModuleConstant moduleConstant)
- 指定者:
visitModuleConstant在接口中ConstantVisitor
-
visitPackageConstant
public void visitPackageConstant(Clazz clazz, PackageConstant packageConstant)
- 指定者:
visitPackageConstant在接口中ConstantVisitor
-
visitFieldrefConstant
public void visitFieldrefConstant(Clazz clazz, FieldrefConstant fieldrefConstant)
- 指定者:
visitFieldrefConstant在接口中ConstantVisitor
-
visitDynamicConstant
public void visitDynamicConstant(Clazz clazz, DynamicConstant dynamicConstant)
- 指定者:
visitDynamicConstant在接口中ConstantVisitor
-
visitInvokeDynamicConstant
public void visitInvokeDynamicConstant(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant)
- 指定者:
visitInvokeDynamicConstant在接口中ConstantVisitor
-
visitInterfaceMethodrefConstant
public void visitInterfaceMethodrefConstant(Clazz clazz, InterfaceMethodrefConstant interfaceMethodrefConstant)
-
visitMethodrefConstant
public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant)
- 指定者:
visitMethodrefConstant在接口中ConstantVisitor
-
visitNameAndTypeConstant
public void visitNameAndTypeConstant(Clazz clazz, NameAndTypeConstant nameAndTypeConstant)
- 指定者:
visitNameAndTypeConstant在接口中ConstantVisitor
-
toString
public java.lang.String toString()
- 覆盖:
toString在类中java.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- 指定者:
equals在类中Instruction
-
hashCode
public int hashCode()
- 指定者:
hashCode在类中Instruction
-
-