Package com.tonic.analysis.instruction
Enum DupInstruction.DupType
- java.lang.Object
-
- java.lang.Enum<DupInstruction.DupType>
-
- com.tonic.analysis.instruction.DupInstruction.DupType
-
- All Implemented Interfaces:
Serializable,Comparable<DupInstruction.DupType>
- Enclosing class:
- DupInstruction
public static enum DupInstruction.DupType extends Enum<DupInstruction.DupType>
The stack-duplication variants (DUP through DUP2_X2), each pairing a JVM opcode with its mnemonic.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DUPCopies the top one-word value and pushes the copy on top of it.DUP_X1Copies the top one-word value and inserts it beneath the one word below.DUP_X2Copies the top one-word value and inserts it beneath the two words below, as used to stash an array reference under a long index or value.DUP2Copies the top two words, which is either one long or double or a pair of one-word values.DUP2_X1Copies the top two words and inserts them beneath the one word below.DUP2_X2Copies the top two words and inserts them beneath the two words below.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DupInstruction.DupTypefromOpcode(int opcode)Looks up the duplication variant for a JVM opcode.StringgetMnemonic()intgetOpcode()static DupInstruction.DupTypevalueOf(String name)Returns the enum constant of this type with the specified name.static DupInstruction.DupType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DUP
public static final DupInstruction.DupType DUP
Copies the top one-word value and pushes the copy on top of it.
-
DUP_X1
public static final DupInstruction.DupType DUP_X1
Copies the top one-word value and inserts it beneath the one word below.
-
DUP_X2
public static final DupInstruction.DupType DUP_X2
Copies the top one-word value and inserts it beneath the two words below, as used to stash an array reference under a long index or value.
-
DUP2
public static final DupInstruction.DupType DUP2
Copies the top two words, which is either one long or double or a pair of one-word values.
-
DUP2_X1
public static final DupInstruction.DupType DUP2_X1
Copies the top two words and inserts them beneath the one word below.
-
DUP2_X2
public static final DupInstruction.DupType DUP2_X2
Copies the top two words and inserts them beneath the two words below.
-
-
Method Detail
-
values
public static DupInstruction.DupType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DupInstruction.DupType c : DupInstruction.DupType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DupInstruction.DupType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getOpcode
public int getOpcode()
- Returns:
- the opcode
-
getMnemonic
public String getMnemonic()
- Returns:
- the mnemonic
-
fromOpcode
public static DupInstruction.DupType fromOpcode(int opcode)
Looks up the duplication variant for a JVM opcode.- Parameters:
opcode- the JVM opcode- Returns:
- the matching variant, or null if the opcode is not a DUP-family opcode
-
-