java.lang.Object
org.glavo.classfile.impl.AbstractElement
org.glavo.classfile.impl.LabelImpl
- All Implemented Interfaces:
ClassFileElement,CodeElement,LabelTarget,Label,PseudoInstruction
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.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.glavo.classfile.impl.AbstractElement
writeTo, writeTo, writeTo
-
Constructor Details
-
LabelImpl
-
-
Method Details
-
labelContext
-
getBCI
public int getBCI() -
setBCI
public void setBCI(int bci) -
label
Description copied from interface:LabelTargetReturns the label corresponding to this target.- Specified by:
labelin interfaceLabelTarget- Returns:
- the label corresponding to this target
-
writeTo
- Overrides:
writeToin classAbstractElement
-
toString
-