Package com.tonic.analysis.instruction
Enum CompareInstruction.CompareType
- java.lang.Object
-
- java.lang.Enum<CompareInstruction.CompareType>
-
- com.tonic.analysis.instruction.CompareInstruction.CompareType
-
- All Implemented Interfaces:
Serializable,Comparable<CompareInstruction.CompareType>
- Enclosing class:
- CompareInstruction
public static enum CompareInstruction.CompareType extends Enum<CompareInstruction.CompareType>
The compare operation kinds, each pairing a JVM opcode with its mnemonic.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DCMPGCompares two doubles, pushing 1 when either operand is NaN.DCMPLCompares two doubles, pushing -1 when either operand is NaN.FCMPGCompares two floats, pushing 1 when either operand is NaN.FCMPLCompares two floats, pushing -1 when either operand is NaN.LCMPCompares two longs, pushing -1, 0, or 1; longs have no NaN, so there is only one variant.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompareInstruction.CompareTypefromOpcode(int opcode)Looks up the compare type for a JVM opcode.StringgetMnemonic()intgetOpcode()static CompareInstruction.CompareTypevalueOf(String name)Returns the enum constant of this type with the specified name.static CompareInstruction.CompareType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LCMP
public static final CompareInstruction.CompareType LCMP
Compares two longs, pushing -1, 0, or 1; longs have no NaN, so there is only one variant.
-
FCMPL
public static final CompareInstruction.CompareType FCMPL
Compares two floats, pushing -1 when either operand is NaN.
-
FCMPG
public static final CompareInstruction.CompareType FCMPG
Compares two floats, pushing 1 when either operand is NaN.
-
DCMPL
public static final CompareInstruction.CompareType DCMPL
Compares two doubles, pushing -1 when either operand is NaN.
-
DCMPG
public static final CompareInstruction.CompareType DCMPG
Compares two doubles, pushing 1 when either operand is NaN.
-
-
Method Detail
-
values
public static CompareInstruction.CompareType[] 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 (CompareInstruction.CompareType c : CompareInstruction.CompareType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CompareInstruction.CompareType 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 CompareInstruction.CompareType fromOpcode(int opcode)
Looks up the compare type for a JVM opcode.- Parameters:
opcode- the JVM opcode- Returns:
- the matching type, or null if the opcode is not a compare opcode
-
-