public abstract class Instruction extends Object
| Modifier and Type | Field and Description |
|---|---|
byte |
opcode |
| Constructor and Description |
|---|
Instruction() |
| Modifier and Type | Method and Description |
|---|---|
abstract 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.
|
String |
getName()
Returns the name of the instruction.
|
boolean |
isCategory2()
Returns whether the instruction is a Category 2 instruction.
|
protected boolean |
isWide()
Returns whether the instruction is wide, i.e.
|
abstract int |
length(int offset)
Returns the length in bytes of the instruction.
|
boolean |
mayThrowExceptions()
Returns whether the instruction may throw exceptions.
|
protected static int |
readByte(byte[] code,
int offset) |
protected abstract void |
readInfo(byte[] code,
int offset)
Reads the data following the instruction opcode.
|
protected static int |
readInt(byte[] code,
int offset) |
protected static int |
readShort(byte[] code,
int offset) |
protected static int |
readSignedByte(byte[] code,
int offset) |
protected static int |
readSignedShort(byte[] code,
int offset) |
protected static int |
readSignedValue(byte[] code,
int offset,
int valueSize) |
protected static int |
readValue(byte[] code,
int offset,
int valueSize) |
abstract 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(int offset)
Returns a description of the instruction, at the given offset.
|
void |
write(byte[] code,
int offset)
Writes the Instruction at the given offset in the given code array.
|
void |
write(CodeAttribute codeAttribute,
int offset)
Writes the Instruction at the given offset in the given code attribute.
|
protected static void |
writeByte(byte[] code,
int offset,
int value) |
protected abstract void |
writeInfo(byte[] code,
int offset)
Writes data following the instruction opcode.
|
protected static void |
writeInt(byte[] code,
int offset,
int value) |
protected static void |
writeShort(byte[] code,
int offset,
int value) |
protected static void |
writeSignedByte(byte[] code,
int offset,
int value) |
protected static void |
writeSignedShort(byte[] code,
int offset,
int value) |
protected static void |
writeSignedValue(byte[] code,
int offset,
int value,
int valueSize) |
protected static void |
writeValue(byte[] code,
int offset,
int value,
int valueSize) |
public byte canonicalOpcode()
public abstract Instruction shrink()
public final void write(CodeAttribute codeAttribute, int offset)
public void write(byte[] code,
int offset)
protected boolean isWide()
protected abstract void readInfo(byte[] code,
int offset)
protected abstract void writeInfo(byte[] code,
int offset)
public abstract int length(int offset)
public abstract void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, InstructionVisitor instructionVisitor)
public String toString(int offset)
public String getName()
public boolean mayThrowExceptions()
public boolean isCategory2()
public int stackPopCount(Clazz clazz)
public int stackPushCount(Clazz clazz)
protected static int readByte(byte[] code,
int offset)
protected static int readShort(byte[] code,
int offset)
protected static int readInt(byte[] code,
int offset)
protected static int readValue(byte[] code,
int offset,
int valueSize)
protected static int readSignedByte(byte[] code,
int offset)
protected static int readSignedShort(byte[] code,
int offset)
protected static int readSignedValue(byte[] code,
int offset,
int valueSize)
protected static void writeByte(byte[] code,
int offset,
int value)
protected static void writeShort(byte[] code,
int offset,
int value)
protected static void writeInt(byte[] code,
int offset,
int value)
protected static void writeValue(byte[] code,
int offset,
int value,
int valueSize)
protected static void writeSignedByte(byte[] code,
int offset,
int value)
protected static void writeSignedShort(byte[] code,
int offset,
int value)
protected static void writeSignedValue(byte[] code,
int offset,
int value,
int valueSize)
Copyright © 2015. All Rights Reserved.