Class ByteCodeForm
java.lang.Object
org.apache.commons.compress.harmony.unpack200.bytecode.forms.ByteCodeForm
- Direct Known Subclasses:
ByteForm
,IincForm
,LabelForm
,LocalForm
,NoArgumentForm
,ReferenceForm
,ShortForm
,VariableInstructionForm
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final ByteCodeForm[]
protected static final Map<String,
ByteCodeForm> protected static final boolean
-
Constructor Summary
ConstructorDescriptionByteCodeForm
(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 -
Method Summary
Modifier and TypeMethodDescriptionprotected void
int
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) getName()
int
int[]
int[]
boolean
This method will answer true if the receiver is a multi-bytecode instruction (such as aload0_putfield_super); otherwise, it will answer false.boolean
boolean
int
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.toString()
-
Field Details
-
WIDENED
- See Also:
-
byteCodeArray
-
byteCodesByName
-
-
Constructor Details
-
ByteCodeForm
Answer a new instance of this class with the specified opcode and name. Assume no rewrite.- Parameters:
opcode
- int corresponding to the opcode's valuename
- String printable name of the opcode
-
ByteCodeForm
Answer a new instance of this class with the specified opcode, name, operandType and rewrite- Parameters:
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.
-
-
Method Details
-
get
-
calculateOperandPosition
-
firstOperandIndex
-
fixUpByteCodeTargets
The ByteCodeForm knows how to fix up a bytecode if it needs to be fixed up because it holds a Label bytecode.- Parameters:
byteCode
- a ByteCode to be fixed upcodeAttribute
- a CodeAttribute used to determine how the ByteCode should be fixed up.
-
getName
-
getOpcode
-
getRewrite
-
getRewriteCopy
-
hasMultipleByteCodes
This method will answer true if the receiver is a multi-bytecode instruction (such as aload0_putfield_super); otherwise, it will answer false.- Returns:
- boolean true if multibytecode, false otherwise
-
hasNoOperand
-
nestedMustStartClassPool
-
operandLength
-
setByteCodeOperands
public 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.- Parameters:
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).
-
toString
-