public abstract class ByteCodeForm extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static ByteCodeForm[] |
byteCodeArray |
protected static java.util.Map |
byteCodesByName |
protected static boolean |
WIDENED |
Constructor and Description |
---|
ByteCodeForm(int opcode,
java.lang.String name)
Answer a new instance of this class with the specified opcode and name.
|
ByteCodeForm(int opcode,
java.lang.String name,
int[] rewrite)
Answer a new instance of this class with the specified opcode, name, operandType and rewrite
|
Modifier and Type | Method and Description |
---|---|
protected void |
calculateOperandPosition() |
int |
firstOperandIndex() |
void |
fixUpByteCodeTargets(ByteCode byteCode,
CodeAttribute codeAttribute)
The ByteCodeForm knows how to fix up a bytecode if it needs to be fixed up because it holds a Label bytecode.
|
static ByteCodeForm |
get(int opcode) |
java.lang.String |
getName() |
int |
getOpcode() |
int[] |
getRewrite() |
int[] |
getRewriteCopy() |
boolean |
hasMultipleByteCodes()
This method will answer true if the receiver is a multi-bytecode instruction (such as aload0_putfield_super);
otherwise, it will answer false.
|
boolean |
hasNoOperand() |
boolean |
nestedMustStartClassPool() |
int |
operandLength() |
abstract void |
setByteCodeOperands(ByteCode byteCode,
OperandManager operandManager,
int codeLength)
When passed a byteCode, an OperandTable and a SegmentConstantPool, this method will set the rewrite of the
byteCode appropriately.
|
java.lang.String |
toString() |
protected static final boolean WIDENED
protected static final ByteCodeForm[] byteCodeArray
protected static final java.util.Map byteCodesByName
public ByteCodeForm(int opcode, java.lang.String name)
opcode
- int corresponding to the opcode's valuename
- String printable name of the opcodepublic ByteCodeForm(int opcode, java.lang.String name, int[] rewrite)
opcode
- int corresponding to the opcode's valuename
- String printable name of the opcoderewrite
- int[] Array of ints. Operand positions (which will later be rewritten in ByteCodes) are indicated
by -1.protected void calculateOperandPosition()
public static ByteCodeForm get(int opcode)
public java.lang.String toString()
toString
in class java.lang.Object
public int getOpcode()
public java.lang.String getName()
public int[] getRewrite()
public int[] getRewriteCopy()
public int firstOperandIndex()
public int operandLength()
public boolean hasNoOperand()
public boolean hasMultipleByteCodes()
public abstract void setByteCodeOperands(ByteCode byteCode, OperandManager operandManager, int codeLength)
byteCode
- ByteCode to be updated (!)operandManager
- OperandTable from which to draw infocodeLength
- Length of bytes (excluding this bytecode) from the beginning of the method. Used in calculating
padding for some variable-length bytecodes (such as lookupswitch, tableswitch).public void fixUpByteCodeTargets(ByteCode byteCode, CodeAttribute codeAttribute)
byteCode
- a ByteCode to be fixed upcodeAttribute
- a CodeAttribute used to determine how the ByteCode should be fixed up.public boolean nestedMustStartClassPool()