Modifier and Type | Field and Description |
---|---|
private static InstructionComparator | |
pack-priv static final Instruction[] | |
protected short | length
Deprecated
(since 6.0) will be made private; do not access directly, use getter/setter
|
protected short | opcode
Deprecated
(since 6.0) will be made private; do not access directly, use getter/setter
|
Access | Constructor and Description |
---|---|
pack-priv | |
public |
Modifier and Type | Method and Description |
---|---|
public abstract void | |
public int | Returns: Number of words consumed from stack by this instruction, or Constants.UNPREDICTABLE, if this can not be computed staticallyThis method also gives right results for instructions whose effect on the stack depends on the constant pool entry they reference. |
public Instruction | Returns: (shallow) copy of an instructionUse with caution, since 'BranchInstruction's have a 'target' reference which is not copied correctly (only basic types are). |
pack-priv void | |
public void | |
public boolean | Returns: true if that is an Instruction and has the same opcodethe reference object with which to compare. that)Overrides java. |
public static InstructionComparator | Returns: currently used comparator for equals()
Deprecated
(6.0) use the built in comparator, or wrap this class in another object that implements these methods
Gets Comparator object used in the equals() method to determine equality of instructions.
|
public int | |
public String | |
public short | |
public int | Returns: the hashCodeOverrides java. |
protected void | initFromFile(final ByteSequence
byte sequence to read from bytes, final boolean "wide" instruction flag wide)Reads needed data (e.g. index) from file. |
public static boolean | Returns: true if the value is in rangethe value to check value)Tests if the value can fit in a byte (signed) |
public static boolean | Returns: true if the value is in rangethe value to check value)Tests if the value can fit in a short (signed) |
public int | Returns: Number of words produced onto stack by this instruction, or Constants.UNPREDICTABLE, if this can not be computed staticallyThis method also gives right results for instructions whose effect on the stack depends on the constant pool entry they reference. |
public static Instruction | Returns: instruction object being readinput stream bytes bytes)Reads an instruction from (byte code) input stream and return the appropriate object. |
public static void | setComparator(final InstructionComparator c)
Deprecated
(6.0) use the built in comparator, or wrap this class in another object that implements these methods
Sets comparator to be used for equals().
|
pack-priv final void | |
pack-priv void | |
public String | Returns: mnemonic for instruction in verbose formatOverrides java. |
public String | Returns: mnemonic for instructionlong/short format switch verbose)Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")" |
public String |
cmp | back to summary |
---|---|
private static InstructionComparator cmp |
EMPTY_ARRAY | back to summary |
---|---|
pack-priv static final Instruction[] EMPTY_ARRAY |
length | back to summary |
---|---|
protected short length
Deprecated (since 6.0) will be made private; do not access directly, use getter/setter |
opcode | back to summary |
---|---|
protected short opcode
Deprecated (since 6.0) will be made private; do not access directly, use getter/setter |
Instruction | back to summary |
---|---|
pack-priv Instruction() Empty constructor needed for Instruction.readInstruction. Not to be used otherwise. |
Instruction | back to summary |
---|---|
public Instruction(final short opcode, final short length) |
accept | back to summary |
---|---|
public abstract void accept(Visitor v) Call corresponding visitor method(s). The order is: Call visitor methods of implemented interfaces first, then call methods according to the class hierarchy in descending order, i.e., the most specific visitXXX() call comes last.
|
consumeStack | back to summary |
---|---|
public int consumeStack(final ConstantPoolGen cpg) This method also gives right results for instructions whose effect on the stack depends on the constant pool entry they reference.
|
copy | back to summary |
---|---|
public Instruction copy() Use with caution, since 'BranchInstruction's have a 'target' reference which is not copied correctly (only basic types are). This also applies for 'Select' instructions with their multiple branch targets.
|
dispose | back to summary |
---|---|
pack-priv void dispose() Some instructions may be reused, so don't do anything by default. |
dump | back to summary |
---|---|
public void dump(final DataOutputStream out) throws IOException Dumps instruction as byte code to stream out.
|
equals | back to summary |
---|---|
public boolean equals(final Object that) Overrides java. Tests for equality, delegated to comparator
|
getComparator | back to summary |
---|---|
public static InstructionComparator getComparator()
Deprecated (6.0) use the built in comparator, or wrap this class in another object that implements these methods Gets Comparator object used in the equals() method to determine equality of instructions.
|
getLength | back to summary |
---|---|
public int getLength()
|
getName | back to summary |
---|---|
public String getName()
|
getOpcode | back to summary |
---|---|
public short getOpcode()
|
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Gets the hashCode of this object.
|
initFromFile | back to summary |
---|---|
protected void initFromFile(final ByteSequence bytes, final boolean wide) throws IOException Reads needed data (e.g. index) from file.
|
isValidByte | back to summary |
---|---|
public static boolean isValidByte(final int value) Tests if the value can fit in a byte (signed)
|
isValidShort | back to summary |
---|---|
public static boolean isValidShort(final int value) Tests if the value can fit in a short (signed)
|
produceStack | back to summary |
---|---|
public int produceStack(final ConstantPoolGen cpg) This method also gives right results for instructions whose effect on the stack depends on the constant pool entry they reference.
|
readInstruction | back to summary |
---|---|
public static Instruction readInstruction(final ByteSequence bytes) throws IOException Reads an instruction from (byte code) input stream and return the appropriate object.
If the Instruction is defined in
|
setComparator | back to summary |
---|---|
public static void setComparator(final InstructionComparator c)
Deprecated (6.0) use the built in comparator, or wrap this class in another object that implements these methods Sets comparator to be used for equals().
|
setLength | back to summary |
---|---|
pack-priv final void setLength(final int length) Needed in readInstruction and subclasses in this package
|
setOpcode | back to summary |
---|---|
pack-priv void setOpcode(final short opcode) Needed in readInstruction and subclasses in this package |
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object. |
toString | back to summary |
---|---|
public String toString(final boolean verbose) Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")"
|
toString | back to summary |
---|---|
public String toString(final ConstantPool cp)
|