# Uses of Enum Class
java.lang.classfile.Opcode

Packages that use Opcode
Package
Description
java.lang.classfile
Provides classfile parsing, generation, and transformation library.
java.lang.classfile.instruction
Provides interfaces describing code instructions for the `java.lang.classfile` library.

## Uses of Opcode in java.lang.classfile

Subclasses with type arguments of type Opcode in java.lang.classfile
Modifier and Type
Class
Description
`enum`
`Opcode`
Describes the opcodes of the JVM instruction set, as described in JVMS §6.5.
Methods in java.lang.classfile that return Opcode
Modifier and Type
Method
Description
`Opcode`
Instruction.`opcode()`
Returns the operation of this instruction.
`static Opcode`
Opcode.`valueOf(String name)`
Returns the enum constant of this class with the specified name.
`static Opcode[]`
Opcode.`values()`
Returns an array containing the constants of this enum class, in the order they are declared.
Methods in java.lang.classfile with parameters of type Opcode
Modifier and Type
Method
Description
`default CodeBuilder`
CodeBuilder.`branch(Opcode op, Label target)`
Generates a branch instruction.
`default CodeBuilder`
CodeBuilder.`fieldAccess(Opcode opcode, FieldRefEntry ref)`
Generates an instruction to access a field.
`default CodeBuilder`
CodeBuilder.`fieldAccess(Opcode opcode, ClassDesc owner, String name, ClassDesc type)`
Generates an instruction to access a field.
`default CodeBuilder`
CodeBuilder.`ifThen(Opcode opcode, Consumer<CodeBuilder.BlockCodeBuilder> thenHandler)`
Adds an "if-then" block that is conditional on the value(s) on top of the operand stack in accordance with the given opcode.
`default CodeBuilder`
CodeBuilder.`ifThenElse(Opcode opcode, Consumer<CodeBuilder.BlockCodeBuilder> thenHandler, Consumer<CodeBuilder.BlockCodeBuilder> elseHandler)`
Adds an "if-then-else" block that is conditional on the value(s) on top of the operand stack in accordance with the given opcode.
`default CodeBuilder`
CodeBuilder.`invoke(Opcode opcode, MemberRefEntry ref)`
Generates an instruction to invoke a method.
`default CodeBuilder`
CodeBuilder.`invoke(Opcode opcode, ClassDesc owner, String name, MethodTypeDesc desc, boolean isInterface)`
Generates an instruction to invoke a method.

## Uses of Opcode in java.lang.classfile.instruction

Methods in java.lang.classfile.instruction with parameters of type Opcode
Modifier and Type
Method
Description
`static ArrayLoadInstruction`
ArrayLoadInstruction.`of(Opcode op)`
Returns an array load instruction.
`static ArrayStoreInstruction`
ArrayStoreInstruction.`of(Opcode op)`
Returns an array store instruction.
`static BranchInstruction`
BranchInstruction.`of(Opcode op, Label target)`
Returns a branch instruction.
`static ConvertInstruction`
ConvertInstruction.`of(Opcode op)`
Returns a conversion instruction.
`static DiscontinuedInstruction.JsrInstruction`
DiscontinuedInstruction.JsrInstruction.`of(Opcode op, Label target)`
Returns a jump subroutine instruction.
`static DiscontinuedInstruction.RetInstruction`
DiscontinuedInstruction.RetInstruction.`of(Opcode op, int slot)`
Returns a return from subroutine instruction.
`static FieldInstruction`
FieldInstruction.`of(Opcode op, ClassEntry owner, NameAndTypeEntry nameAndType)`
Returns a field access instruction.
`static FieldInstruction`
FieldInstruction.`of(Opcode op, ClassEntry owner, Utf8Entry name, Utf8Entry type)`
Returns a field access instruction.
`static FieldInstruction`
FieldInstruction.`of(Opcode op, FieldRefEntry field)`
Returns a field access instruction.
`static IncrementInstruction`
IncrementInstruction.`of(Opcode op, int slot, int constant)`
Returns an increment instruction.
`static InvokeInstruction`
InvokeInstruction.`of(Opcode op, ClassEntry owner, NameAndTypeEntry nameAndType, boolean isInterface)`
Returns an invocation instruction.
`static InvokeInstruction`
InvokeInstruction.`of(Opcode op, ClassEntry owner, Utf8Entry name, Utf8Entry type, boolean isInterface)`
Returns an invocation instruction.
`static InvokeInstruction`
InvokeInstruction.`of(Opcode op, MemberRefEntry method)`
Returns an invocation instruction.
`static LoadInstruction`
LoadInstruction.`of(Opcode op, int slot)`
Returns a local variable load instruction.
`static MonitorInstruction`
MonitorInstruction.`of(Opcode op)`
Returns a monitor instruction.
`static OperatorInstruction`
OperatorInstruction.`of(Opcode op)`
Returns an operator instruction.
`static ReturnInstruction`
ReturnInstruction.`of(Opcode op)`
Returns a return instruction.
`static StackInstruction`
StackInstruction.`of(Opcode op)`
Returns a stack manipulation instruction.
`static StoreInstruction`
StoreInstruction.`of(Opcode op, int slot)`
Returns a local variable store instruction.
`static TypeCheckInstruction`
TypeCheckInstruction.`of(Opcode op, ClassEntry type)`
Returns a type check instruction.
`static TypeCheckInstruction`
TypeCheckInstruction.`of(Opcode op, ClassDesc type)`
Returns a type check instruction.
`static ConstantInstruction.ArgumentConstantInstruction`
ConstantInstruction.`ofArgument(Opcode op, int value)`
Returns an argument constant instruction.
`static ConstantInstruction.IntrinsicConstantInstruction`
ConstantInstruction.`ofIntrinsic(Opcode op)`
Returns an intrinsic constant instruction.
`static ConstantInstruction.LoadConstantInstruction`
ConstantInstruction.`ofLoad(Opcode op, LoadableConstantEntry constant)`
Returns a load constant instruction.