APIdia Launch Partner
Top Description Methods
java.lang.classfile.instruction

public sealed Interface MonitorInstruction

extends Instruction
permits UnboundMonitorInstruction
Known Direct Implementers
jdk.internal.classfile.impl.AbstractInstruction.UnboundMonitorInstruction
Imports
java.lang.classfile.CodeBuilder, .CodeElement, .CodeModel, .Instruction, .Opcode, jdk.internal.classfile.impl.AbstractInstruction, .Util

Models a monitorenter or monitorexit instruction in the code array of a Code attribute. Corresponding opcodes have a kind of Opcode.Kind#MONITOR. Delivered as a CodeElement when traversing the elements of a CodeModel.

A monitor instruction is composite:

MonitorInstruction(Opcode opcode)
MonitorInstruction(Opcode opcode)
Since
24

Method Summary

Modifier and TypeMethod and Description
public static MonitorInstruction

Returns:

a monitor instruction
of
(Opcode
the opcode for the specific type of monitor instruction, which must be of kind Opcode.Kind#MONITOR
op
)

Returns a monitor instruction.

Inherited from java.lang.classfile.Instruction:
opcodesizeInBytes

Method Detail

ofback to summary
public static MonitorInstruction of(Opcode op)

Returns a monitor instruction.

Parameters
op:Opcode

the opcode for the specific type of monitor instruction, which must be of kind Opcode.Kind#MONITOR

Returns:MonitorInstruction

a monitor instruction

Exceptions
IllegalArgumentException:
if the opcode kind is not Opcode.Kind#MONITOR.