APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.classfile.impl

public final Class LabelImpl

extends AbstractElement
implements Label, LabelTarget
Class Inheritance
All Implemented Interfaces
java.lang.classfile.instruction.LabelTarget, java.lang.classfile.PseudoInstruction, java.lang.classfile.CodeElement, java.lang.classfile.ClassFileElement, java.lang.classfile.Label
Imports
java.lang.classfile.Label, java.lang.classfile.instruction.LabelTarget

Labels are created with a parent context, which is either a code attribute or a code builder. A label originating in a code attribute context may be reused in a code builder context, but only labels from a single code attribute may be reused by a single code builder. Mappings to and from BCI are the responsibility of the context in which it is used; a single word of mutable state is provided, for the exclusive use of the owning context. In practice, this means that labels created in a code attribute can simply store the BCI in the state on creation, and labels created in in a code builder can store the BCI in the state when the label is eventually set; if a code attribute label is reused in a builder, the original BCI can be used as an index into an array.

Field Summary

Modifier and TypeField and Description
private int
private final LabelContext

Constructor Summary

AccessConstructor and Description
public
LabelImpl(LabelContext labelContext, int bci)

Method Summary

Modifier and TypeMethod and Description
public int
public Label
label()

Implements java.lang.classfile.instruction.LabelTarget.label.

Returns the label corresponding to this target.

public LabelContext
public void
setBCI(int bci)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
Inherited from jdk.internal.classfile.impl.AbstractElement:
writeTowriteTowriteTo

Field Detail

bciback to summary
private int bci
labelContextback to summary
private final LabelContext labelContext

Constructor Detail

LabelImplback to summary
public LabelImpl(LabelContext labelContext, int bci)

Method Detail

getBCIback to summary
public int getBCI()
labelback to summary
public Label label()

Implements java.lang.classfile.instruction.LabelTarget.label.

Doc from java.lang.classfile.instruction.LabelTarget.label.

Returns the label corresponding to this target.

Annotations
@Override
labelContextback to summary
public LabelContext labelContext()
setBCIback to summary
public void setBCI(int bci)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
writeToback to summary
public void writeTo(DirectCodeBuilder builder)

Overrides jdk.internal.classfile.impl.AbstractElement.writeTo.

Annotations
@Override