Package com.tonic.analysis.instruction
Enum ConditionalBranchInstruction.BranchType
- java.lang.Object
-
- java.lang.Enum<ConditionalBranchInstruction.BranchType>
-
- com.tonic.analysis.instruction.ConditionalBranchInstruction.BranchType
-
- All Implemented Interfaces:
Serializable,Comparable<ConditionalBranchInstruction.BranchType>
- Enclosing class:
- ConditionalBranchInstruction
public static enum ConditionalBranchInstruction.BranchType extends Enum<ConditionalBranchInstruction.BranchType>
The conditional branch kinds, each pairing a JVM opcode with its mnemonic.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description IF_ACMPEQBranches when two popped references point at the same object.IF_ACMPNEBranches when two popped references do not point at the same object.IF_ICMPEQBranches when two popped ints are equal.IF_ICMPGEBranches when the first of two popped ints is>=the second.IF_ICMPGTBranches when the first of two popped ints is>the second.IF_ICMPLEBranches when the first of two popped ints is<=the second.IF_ICMPLTBranches when the first of two popped ints is<the second.IF_ICMPNEBranches when two popped ints differ.IFEQBranches when the popped int is zero, the usual test for a false boolean.IFGEBranches when the popped int is>= 0.IFGTBranches when the popped int is> 0.IFLEBranches when the popped int is<= 0.IFLTBranches when the popped int is< 0.IFNEBranches when the popped int is non-zero, the usual test for a true boolean.IFNONNULLBranches when the popped reference is not null.IFNULLBranches when the popped reference is null.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConditionalBranchInstruction.BranchTypefromOpcode(int opcode)Looks up the branch type for a JVM opcode.StringgetMnemonic()intgetOpcode()static ConditionalBranchInstruction.BranchTypevalueOf(String name)Returns the enum constant of this type with the specified name.static ConditionalBranchInstruction.BranchType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
IFEQ
public static final ConditionalBranchInstruction.BranchType IFEQ
Branches when the popped int is zero, the usual test for a false boolean.
-
IFNE
public static final ConditionalBranchInstruction.BranchType IFNE
Branches when the popped int is non-zero, the usual test for a true boolean.
-
IFLT
public static final ConditionalBranchInstruction.BranchType IFLT
Branches when the popped int is< 0.
-
IFGE
public static final ConditionalBranchInstruction.BranchType IFGE
Branches when the popped int is>= 0.
-
IFGT
public static final ConditionalBranchInstruction.BranchType IFGT
Branches when the popped int is> 0.
-
IFLE
public static final ConditionalBranchInstruction.BranchType IFLE
Branches when the popped int is<= 0.
-
IF_ICMPEQ
public static final ConditionalBranchInstruction.BranchType IF_ICMPEQ
Branches when two popped ints are equal.
-
IF_ICMPNE
public static final ConditionalBranchInstruction.BranchType IF_ICMPNE
Branches when two popped ints differ.
-
IF_ICMPLT
public static final ConditionalBranchInstruction.BranchType IF_ICMPLT
Branches when the first of two popped ints is<the second.
-
IF_ICMPGE
public static final ConditionalBranchInstruction.BranchType IF_ICMPGE
Branches when the first of two popped ints is>=the second.
-
IF_ICMPGT
public static final ConditionalBranchInstruction.BranchType IF_ICMPGT
Branches when the first of two popped ints is>the second.
-
IF_ICMPLE
public static final ConditionalBranchInstruction.BranchType IF_ICMPLE
Branches when the first of two popped ints is<=the second.
-
IF_ACMPEQ
public static final ConditionalBranchInstruction.BranchType IF_ACMPEQ
Branches when two popped references point at the same object.
-
IF_ACMPNE
public static final ConditionalBranchInstruction.BranchType IF_ACMPNE
Branches when two popped references do not point at the same object.
-
IFNULL
public static final ConditionalBranchInstruction.BranchType IFNULL
Branches when the popped reference is null.
-
IFNONNULL
public static final ConditionalBranchInstruction.BranchType IFNONNULL
Branches when the popped reference is not null.
-
-
Method Detail
-
values
public static ConditionalBranchInstruction.BranchType[] 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 (ConditionalBranchInstruction.BranchType c : ConditionalBranchInstruction.BranchType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConditionalBranchInstruction.BranchType 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 ConditionalBranchInstruction.BranchType fromOpcode(int opcode)
Looks up the branch type for a JVM opcode.- Parameters:
opcode- the JVM opcode- Returns:
- the matching type, or null if the opcode is not a conditional branch opcode
-
-