public class ConstantInstruction extends Instruction implements ConstantVisitor
| Modifier and Type | Field and Description |
|---|---|
int |
constant |
int |
constantIndex |
opcode| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
InstructionVisitor instructionVisitor)
Accepts the given visitor.
|
byte |
canonicalOpcode()
Returns the canonical opcode of this instruction, i.e.
|
ConstantInstruction |
copy(ConstantInstruction constantInstruction)
Copies the given instruction into this instruction.
|
int |
length(int offset)
Returns the length in bytes of the instruction.
|
protected void |
readInfo(byte[] code,
int offset)
Reads the data following the instruction opcode.
|
Instruction |
shrink()
Shrinks this instruction to its shortest possible form.
|
int |
stackPopCount(Clazz clazz)
Returns the number of entries popped from the stack during the execution
of the instruction.
|
int |
stackPushCount(Clazz clazz)
Returns the number of entries pushed onto the stack during the execution
of the instruction.
|
String |
toString() |
void |
visitClassConstant(Clazz clazz,
ClassConstant classConstant) |
void |
visitDoubleConstant(Clazz clazz,
DoubleConstant doubleConstant) |
void |
visitFieldrefConstant(Clazz clazz,
FieldrefConstant fieldrefConstant) |
void |
visitFloatConstant(Clazz clazz,
FloatConstant floatConstant) |
void |
visitIntegerConstant(Clazz clazz,
IntegerConstant integerConstant) |
void |
visitInterfaceMethodrefConstant(Clazz clazz,
InterfaceMethodrefConstant interfaceMethodrefConstant) |
void |
visitInvokeDynamicConstant(Clazz clazz,
InvokeDynamicConstant invokeDynamicConstant) |
void |
visitLongConstant(Clazz clazz,
LongConstant longConstant) |
void |
visitMethodHandleConstant(Clazz clazz,
MethodHandleConstant methodHandleConstant) |
void |
visitMethodrefConstant(Clazz clazz,
MethodrefConstant methodrefConstant) |
void |
visitMethodTypeConstant(Clazz clazz,
MethodTypeConstant methodTypeConstant) |
void |
visitNameAndTypeConstant(Clazz clazz,
NameAndTypeConstant nameAndTypeConstant) |
void |
visitStringConstant(Clazz clazz,
StringConstant stringConstant) |
void |
visitUtf8Constant(Clazz clazz,
Utf8Constant utf8Constant) |
protected void |
writeInfo(byte[] code,
int offset)
Writes data following the instruction opcode.
|
getName, isCategory2, isWide, mayThrowExceptions, readByte, readInt, readShort, readSignedByte, readSignedShort, readSignedValue, readValue, toString, write, write, writeByte, writeInt, writeShort, writeSignedByte, writeSignedShort, writeSignedValue, writeValuepublic ConstantInstruction()
public ConstantInstruction(byte opcode,
int constantIndex)
public ConstantInstruction(byte opcode,
int constantIndex,
int constant)
public ConstantInstruction copy(ConstantInstruction constantInstruction)
constantInstruction - the instruction to be copied.public byte canonicalOpcode()
InstructioncanonicalOpcode in class Instructionpublic Instruction shrink()
Instructionshrink in class Instructionprotected void readInfo(byte[] code,
int offset)
InstructionreadInfo in class Instructionprotected void writeInfo(byte[] code,
int offset)
InstructionwriteInfo in class Instructionpublic int length(int offset)
Instructionlength in class Instructionpublic void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, InstructionVisitor instructionVisitor)
Instructionaccept in class Instructionpublic int stackPopCount(Clazz clazz)
InstructionstackPopCount in class Instructionpublic int stackPushCount(Clazz clazz)
InstructionstackPushCount in class Instructionpublic void visitIntegerConstant(Clazz clazz, IntegerConstant integerConstant)
visitIntegerConstant in interface ConstantVisitorpublic void visitLongConstant(Clazz clazz, LongConstant longConstant)
visitLongConstant in interface ConstantVisitorpublic void visitFloatConstant(Clazz clazz, FloatConstant floatConstant)
visitFloatConstant in interface ConstantVisitorpublic void visitDoubleConstant(Clazz clazz, DoubleConstant doubleConstant)
visitDoubleConstant in interface ConstantVisitorpublic void visitStringConstant(Clazz clazz, StringConstant stringConstant)
visitStringConstant in interface ConstantVisitorpublic void visitUtf8Constant(Clazz clazz, Utf8Constant utf8Constant)
visitUtf8Constant in interface ConstantVisitorpublic void visitMethodHandleConstant(Clazz clazz, MethodHandleConstant methodHandleConstant)
visitMethodHandleConstant in interface ConstantVisitorpublic void visitClassConstant(Clazz clazz, ClassConstant classConstant)
visitClassConstant in interface ConstantVisitorpublic void visitMethodTypeConstant(Clazz clazz, MethodTypeConstant methodTypeConstant)
visitMethodTypeConstant in interface ConstantVisitorpublic void visitFieldrefConstant(Clazz clazz, FieldrefConstant fieldrefConstant)
visitFieldrefConstant in interface ConstantVisitorpublic void visitInvokeDynamicConstant(Clazz clazz, InvokeDynamicConstant invokeDynamicConstant)
visitInvokeDynamicConstant in interface ConstantVisitorpublic void visitInterfaceMethodrefConstant(Clazz clazz, InterfaceMethodrefConstant interfaceMethodrefConstant)
visitInterfaceMethodrefConstant in interface ConstantVisitorpublic void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant)
visitMethodrefConstant in interface ConstantVisitorpublic void visitNameAndTypeConstant(Clazz clazz, NameAndTypeConstant nameAndTypeConstant)
visitNameAndTypeConstant in interface ConstantVisitorCopyright © 2015. All Rights Reserved.