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

public sealed Interface StackInstruction

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

Models a stack manipulation instruction in the code array of a Code attribute. Corresponding opcodes have a kind of Opcode.Kind#STACK. Delivered as a CodeElement when traversing the elements of a CodeModel.

A stack manipulation instruction is composite:

StackInstruction(Opcode opcode)
StackInstruction(Opcode opcode)
Since
24
See Also
Opcode.Kind#STACK

Method Summary

Modifier and TypeMethod and Description
public static StackInstruction

Returns:

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

Returns a stack manipulation instruction.

Inherited from java.lang.classfile.Instruction:
opcodesizeInBytes

Method Detail

ofback to summary
public static StackInstruction of(Opcode op)

Returns a stack manipulation instruction.

Parameters
op:Opcode

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

Returns:StackInstruction

a stack manipulation instruction

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