public abstract class ByteCodeForm extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static ByteCodeForm[] |
byteCodeArray |
protected static Map |
byteCodesByName |
protected static boolean |
WIDENED |
| Constructor and Description |
|---|
ByteCodeForm(int opcode,
String name)
Answer a new instance of this class with the specified opcode and name.
|
ByteCodeForm(int opcode,
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) |
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.
|
String |
toString() |
protected static final boolean WIDENED
protected static final ByteCodeForm[] byteCodeArray
protected static final Map byteCodesByName
public ByteCodeForm(int opcode, String name)
opcode - int corresponding to the opcode's valuename - String printable name of the opcodepublic ByteCodeForm(int opcode, 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 int getOpcode()
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()
Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.