Package com.tonic.analysis.instruction
Enum GotoInstruction.GotoType
- java.lang.Object
-
- java.lang.Enum<GotoInstruction.GotoType>
-
- com.tonic.analysis.instruction.GotoInstruction.GotoType
-
- All Implemented Interfaces:
Serializable,Comparable<GotoInstruction.GotoType>
- Enclosing class:
- GotoInstruction
public static enum GotoInstruction.GotoType extends Enum<GotoInstruction.GotoType>
The goto widths (16-bit GOTO vs 32-bit GOTO_W), each pairing a JVM opcode with its mnemonic.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description GOTO_NORMALPlaingoto, three bytes wide, carrying a signed 16-bit relative offset.GOTO_WIDEWidegoto_w, five bytes wide, carrying a signed 32-bit relative offset for targets a 16-bit branch cannot reach.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GotoInstruction.GotoTypefromOpcode(int opcode)Looks up the goto width for a JVM opcode.StringgetMnemonic()intgetOpcode()static GotoInstruction.GotoTypevalueOf(String name)Returns the enum constant of this type with the specified name.static GotoInstruction.GotoType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
GOTO_NORMAL
public static final GotoInstruction.GotoType GOTO_NORMAL
Plaingoto, three bytes wide, carrying a signed 16-bit relative offset.
-
GOTO_WIDE
public static final GotoInstruction.GotoType GOTO_WIDE
Widegoto_w, five bytes wide, carrying a signed 32-bit relative offset for targets a 16-bit branch cannot reach.
-
-
Method Detail
-
values
public static GotoInstruction.GotoType[] 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 (GotoInstruction.GotoType c : GotoInstruction.GotoType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GotoInstruction.GotoType 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 GotoInstruction.GotoType fromOpcode(int opcode)
Looks up the goto width for a JVM opcode.- Parameters:
opcode- the JVM opcode- Returns:
- the matching width, or null if the opcode is not GOTO or GOTO_W
-
-