Top Description Methods
java.lang.classfile.instruction

public sealed Interface TypeCheckInstruction

extends Instruction
Known Direct Implementers
jdk.internal.classfile.impl.AbstractInstruction.BoundTypeCheckInstruction, jdk.internal.classfile.impl.AbstractInstruction.UnboundTypeCheckInstruction
Annotations
@PreviewFeature
feature:CLASSFILE_API
Imports
java.lang.constant.ClassDesc, java.lang.classfile.CodeElement, .CodeModel, .Instruction, .Opcode, java.lang.classfile.constantpool.ClassEntry, jdk.internal.classfile.impl.AbstractInstruction, .TemporaryConstantPool, .Util, jdk.internal.javac.PreviewFeature

Preview

Second Preview of ClassFile API (JEP 466).

Programs can only use TypeCheckInstruction when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.

Models an instanceof or checkcast instruction in the code array of a Code attribute. Delivered as a CodeElement when traversing the elements of a CodeModel.
Since
22

Method Summary

Modifier and TypeMethod and Description
public static TypeCheckInstruction

Returns:

a type check instruction
of
(Opcode
the opcode for the specific type of type check instruction, which must be of kind Opcode.Kind#TYPE_CHECK
op
,
ClassEntry
the type against which to check or cast
type
)

Returns a type check instruction.

public static TypeCheckInstruction

Returns:

a type check instruction
of
(Opcode
the opcode for the specific type of type check instruction, which must be of kind Opcode.Kind#TYPE_CHECK
op
,
ClassDesc
the type against which to check or cast
type
)

Returns a type check instruction.

public ClassEntry

Returns:

the type against which the instruction checks or casts
type
()

Returns the type against which the instruction checks or casts.

Inherited from java.lang.classfile.Instruction:
opcodesizeInBytes

Method Detail

ofback to summary
public static TypeCheckInstruction of(Opcode op, ClassEntry type)

Returns a type check instruction.

Parameters
op:Opcode

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

type:ClassEntry

the type against which to check or cast

Returns:TypeCheckInstruction

a type check instruction

Exceptions
IllegalArgumentException:
if the opcode kind is not Opcode.Kind#TYPE_CHECK.
ofback to summary
public static TypeCheckInstruction of(Opcode op, ClassDesc type)

Returns a type check instruction.

Parameters
op:Opcode

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

type:ClassDesc

the type against which to check or cast

Returns:TypeCheckInstruction

a type check instruction

typeback to summary
public ClassEntry type()

Returns the type against which the instruction checks or casts.

Returns:ClassEntry

the type against which the instruction checks or casts