| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | bytecodeOffset
The offset of this label in the bytecode of its method, in bytes. |
| pack-priv static final Label | EMPTY_LIST
A sentinel element used to indicate the end of a list of labels. |
| pack-priv static final int | FLAG_DEBUG_ONLY
A flag indicating that a label is only used for debug attributes. |
| pack-priv static final int | FLAG_JUMP_TARGET
A flag indicating that a label is the target of a jump instruction, or the start of an exception handler. |
| pack-priv static final int | FLAG_LINE_NUMBER
A flag indicating that this label has at least one associated line number. |
| pack-priv static final int | FLAG_REACHABLE
A flag indicating that a label corresponds to a reachable basic block. |
| pack-priv static final int | FLAG_RESOLVED
A flag indicating that the bytecode offset of a label is known. |
| pack-priv static final int | FLAG_SUBROUTINE_CALLER
A flag indicating that the basic block corresponding to a label ends with a subroutine call. |
| pack-priv static final int | FLAG_SUBROUTINE_END
A flag indicating that the basic block corresponding to a label is the end of a subroutine. |
| pack-priv static final int | FLAG_SUBROUTINE_START
A flag indicating that the basic block corresponding to a label is the start of a subroutine. |
| pack-priv short | flags
The type and status of this label or its corresponding basic block. |
| pack-priv static final int | FORWARD_REFERENCE_HANDLE_MASK
The bit mask to extract the 'handle' of a forward reference to this label. |
| pack-priv static final int | FORWARD_REFERENCE_TYPE_MASK
The bit mask to extract the type of a forward reference to this label. |
| pack-priv static final int | FORWARD_REFERENCE_TYPE_SHORT
The type of forward references stored with two bytes in the bytecode. |
| pack-priv static final int | FORWARD_REFERENCE_TYPE_WIDE
The type of forward references stored in four bytes in the bytecode. |
| pack-priv static final int | FORWARD_REFERENCES_CAPACITY_INCREMENT
The number of elements to add to the |
| private int[] | forwardReferences
The forward references to this label. |
| pack-priv Frame | frame
The input and output stack map frames of the basic block corresponding to this label. |
| public Object | info
A user managed state associated with this label. |
| pack-priv short | inputStackSize
The number of elements in the input stack of the basic block corresponding to this label. |
| pack-priv static final int | LINE_NUMBERS_CAPACITY_INCREMENT
The number of elements to add to the |
| private short | lineNumber
The source line number corresponding to this label, if |
| pack-priv Label | nextBasicBlock
The successor of this label, in the order they are visited in |
| pack-priv Label | nextListElement
The next element in the list of labels to which this label belongs, or null if it does not belong to any list. |
| private int[] | otherLineNumbers
The source line numbers corresponding to this label, in addition to |
| pack-priv Edge | outgoingEdges
The outgoing edges of the basic block corresponding to this label, in the control flow graph of its method. |
| pack-priv short | outputStackMax
The maximum height reached by the output stack, relatively to the top of the input stack, in the basic block corresponding to this label. |
| pack-priv short | outputStackSize
The number of elements in the output stack, at the end of the basic block corresponding to this label. |
| pack-priv short | subroutineId
The id of the subroutine to which this basic block belongs, or 0. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final void | accept(final MethodVisitor
a method visitor. methodVisitor, final boolean whether to visit of the label's source line numbers, if any. visitLineNumbers)Makes the given visitor visit this label and its source line numbers, if applicable. |
| private void | addForwardReference(final int
the bytecode offset of the instruction that contains the
reference stored at referenceHandle. sourceInsnBytecodeOffset, final int referenceType, final int the offset in the bytecode where the forward reference value must be
stored. referenceHandle)Adds a forward reference to this label. |
| pack-priv final void | addLineNumber(final int
a source line number (which should be strictly positive). lineNumber)Adds a source line number corresponding to this label. |
| pack-priv final void | addSubroutineRetSuccessors(final Label
a basic block that ends with a jsr to the basic block corresponding to
this label. This label is supposed to correspond to the start of a subroutine. subroutineCaller)Finds the basic blocks that end a subroutine starting with the basic block corresponding to this label and, for each one of them, adds an outgoing edge to the basic block following the given subroutine call. |
| pack-priv final Label | Returns: the label itself ifframe is null, otherwise the Label's frame owner. This
corresponds to the "canonical" label instance described above thanks to the way the label
frame is set in MethodWriter#visitLabel.Returns the "canonical" |
| public int | Returns: the bytecode offset corresponding to this label.Returns the bytecode offset corresponding to this label. |
| pack-priv final void | markSubroutine(final short
the id of the subroutine starting with the basic block corresponding to
this label. subroutineId)Finds the basic blocks that belong to the subroutine starting with the basic block corresponding to this label, and marks these blocks as belonging to this subroutine. |
| private Label | Returns: the new list of blocks to process.a list of basic blocks to process, linked together with their
listOfLabelsToProcess)nextListElement field.Adds the successors of this label in the method's control flow graph (except those corresponding to a jsr target, and those already in a list of labels) to the given list of blocks to process, and returns the new list. |
| pack-priv final void | put(final ByteVector
the bytecode of the method. This is where the reference is appended. code, final int the bytecode offset of the instruction that contains the
reference to be appended. sourceInsnBytecodeOffset, final boolean whether the reference must be stored in 4 bytes (instead of 2 bytes). wideReference)Puts a reference to this label in the bytecode of a method. |
| pack-priv final boolean | Returns: true if a blank that was left for this label was too small to store the offset. In such a case the corresponding jump instruction is replaced with an equivalent ASM specific instruction using an unsigned two bytes offset. These ASM specific instructions are later replaced with standard bytecode instructions with wider offsets (4 bytes instead of 2), in ClassReader.the bytecode of the method. code, final int the bytecode offset of this label. bytecodeOffset)Sets the bytecode offset of this label to the given value and resolves the forward references to this label, if any. |
| public String | Returns: a string representation of this label.Overrides java. |
| bytecodeOffset | back to summary |
|---|---|
| pack-priv int bytecodeOffset The offset of this label in the bytecode of its method, in bytes. This value is set if and only
if the | |
| EMPTY_LIST | back to summary |
|---|---|
| pack-priv static final Label EMPTY_LIST A sentinel element used to indicate the end of a list of labels.
| |
| FLAG_DEBUG_ONLY | back to summary |
|---|---|
| pack-priv static final int FLAG_DEBUG_ONLY A flag indicating that a label is only used for debug attributes. Such a label is not the start of a basic block, the target of a jump instruction, or an exception handler. It can be safely ignored in control flow graph analysis algorithms (for optimization purposes). | |
| FLAG_JUMP_TARGET | back to summary |
|---|---|
| pack-priv static final int FLAG_JUMP_TARGET A flag indicating that a label is the target of a jump instruction, or the start of an exception handler. | |
| FLAG_LINE_NUMBER | back to summary |
|---|---|
| pack-priv static final int FLAG_LINE_NUMBER A flag indicating that this label has at least one associated line number. | |
| FLAG_REACHABLE | back to summary |
|---|---|
| pack-priv static final int FLAG_REACHABLE A flag indicating that a label corresponds to a reachable basic block. | |
| FLAG_RESOLVED | back to summary |
|---|---|
| pack-priv static final int FLAG_RESOLVED A flag indicating that the bytecode offset of a label is known. | |
| FLAG_SUBROUTINE_CALLER | back to summary |
|---|---|
| pack-priv static final int FLAG_SUBROUTINE_CALLER A flag indicating that the basic block corresponding to a label ends with a subroutine call. By
construction in
| |
| FLAG_SUBROUTINE_END | back to summary |
|---|---|
| pack-priv static final int FLAG_SUBROUTINE_END A flag indicating that the basic block corresponding to a label is the end of a subroutine. | |
| FLAG_SUBROUTINE_START | back to summary |
|---|---|
| pack-priv static final int FLAG_SUBROUTINE_START A flag indicating that the basic block corresponding to a label is the start of a subroutine. | |
| flags | back to summary |
|---|---|
| pack-priv short flags The type and status of this label or its corresponding basic block. Must be zero or more of
| |
| FORWARD_REFERENCE_HANDLE_MASK | back to summary |
|---|---|
| pack-priv static final int FORWARD_REFERENCE_HANDLE_MASK The bit mask to extract the 'handle' of a forward reference to this label. The extracted handle
is the bytecode offset where the forward reference value is stored (using either 2 or 4 bytes,
as indicated by the
| |
| FORWARD_REFERENCE_TYPE_MASK | back to summary |
|---|---|
| pack-priv static final int FORWARD_REFERENCE_TYPE_MASK The bit mask to extract the type of a forward reference to this label. The extracted type is
either
| |
| FORWARD_REFERENCE_TYPE_SHORT | back to summary |
|---|---|
| pack-priv static final int FORWARD_REFERENCE_TYPE_SHORT The type of forward references stored with two bytes in the bytecode. This is the case, for instance, of a forward reference from an ifnull instruction. | |
| FORWARD_REFERENCE_TYPE_WIDE | back to summary |
|---|---|
| pack-priv static final int FORWARD_REFERENCE_TYPE_WIDE The type of forward references stored in four bytes in the bytecode. This is the case, for instance, of a forward reference from a lookupswitch instruction. | |
| FORWARD_REFERENCES_CAPACITY_INCREMENT | back to summary |
|---|---|
| pack-priv static final int FORWARD_REFERENCES_CAPACITY_INCREMENT The number of elements to add to the | |
| forwardReferences | back to summary |
|---|---|
| private int[] forwardReferences The forward references to this label. The first element is the number of forward references, times 2 (this corresponds to the index of the last element actually used in this array). Then, each forward reference is described with two consecutive integers noted 'sourceInsnBytecodeOffset' and 'reference':
For instance, for an ifnull instruction at bytecode offset x, 'sourceInsnBytecodeOffset' is
equal to x, and 'reference' is of type | |
| frame | back to summary |
|---|---|
| pack-priv Frame frame The input and output stack map frames of the basic block corresponding to this label. This
field is only used when the | |
| info | back to summary |
|---|---|
| public Object info A user managed state associated with this label. Warning this field is used by the ASM tree package. In order to use it with the ASM tree package you must override the getLabelNode method in MethodNode. | |
| inputStackSize | back to summary |
|---|---|
| pack-priv short inputStackSize The number of elements in the input stack of the basic block corresponding to this label. This
field is computed in | |
| LINE_NUMBERS_CAPACITY_INCREMENT | back to summary |
|---|---|
| pack-priv static final int LINE_NUMBERS_CAPACITY_INCREMENT The number of elements to add to the | |
| lineNumber | back to summary |
|---|---|
| private short lineNumber The source line number corresponding to this label, if | |
| nextBasicBlock | back to summary |
|---|---|
| pack-priv Label nextBasicBlock The successor of this label, in the order they are visited in | |
| nextListElement | back to summary |
|---|---|
| pack-priv Label nextListElement The next element in the list of labels to which this label belongs, or null if it
does not belong to any list. All lists of labels must end with the List of labels are used in | |
| otherLineNumbers | back to summary |
|---|---|
| private int[] otherLineNumbers The source line numbers corresponding to this label, in addition to | |
| outgoingEdges | back to summary |
|---|---|
| pack-priv Edge outgoingEdges The outgoing edges of the basic block corresponding to this label, in the control flow graph of
its method. These edges are stored in a linked list of | |
| outputStackMax | back to summary |
|---|---|
| pack-priv short outputStackMax The maximum height reached by the output stack, relatively to the top of the input stack, in the basic block corresponding to this label. This maximum is always positive or null. | |
| outputStackSize | back to summary |
|---|---|
| pack-priv short outputStackSize The number of elements in the output stack, at the end of the basic block corresponding to this label. This field is only computed for basic blocks that end with a RET instruction. | |
| subroutineId | back to summary |
|---|---|
| pack-priv short subroutineId The id of the subroutine to which this basic block belongs, or 0. If the basic block belongs to
several subroutines, this is the id of the "oldest" subroutine that contains it (with the
convention that a subroutine calling another one is "older" than the callee). This field is
computed in | |
| Label | back to summary |
|---|---|
| public Label() Constructs a new label. | |
| accept | back to summary |
|---|---|
| pack-priv final void accept(final MethodVisitor methodVisitor, final boolean visitLineNumbers) Makes the given visitor visit this label and its source line numbers, if applicable.
| |
| addForwardReference | back to summary |
|---|---|
| private void addForwardReference(final int sourceInsnBytecodeOffset, final int referenceType, final int referenceHandle) Adds a forward reference to this label. This method must be called only for a true forward reference, i.e. only if this label is not resolved yet. For backward references, the relative bytecode offset of the reference can be, and must be, computed and stored directly.
| |
| addLineNumber | back to summary |
|---|---|
| pack-priv final void addLineNumber(final int lineNumber) Adds a source line number corresponding to this label.
| |
| addSubroutineRetSuccessors | back to summary |
|---|---|
| pack-priv final void addSubroutineRetSuccessors(final Label subroutineCaller) Finds the basic blocks that end a subroutine starting with the basic block corresponding to this label and, for each one of them, adds an outgoing edge to the basic block following the given subroutine call. In other words, completes the control flow graph by adding the edges corresponding to the return from this subroutine, when called from the given caller basic block. Note a precondition and postcondition of this method is that all labels must have a null
| |
| getCanonicalInstance | back to summary |
|---|---|
| pack-priv final Label getCanonicalInstance() Returns the "canonical" This method should only be used when the
| |
| getOffset | back to summary |
|---|---|
| public int getOffset() Returns the bytecode offset corresponding to this label. This offset is computed from the start
of the method's bytecode. This method is intended for
| |
| markSubroutine | back to summary |
|---|---|
| pack-priv final void markSubroutine(final short subroutineId) Finds the basic blocks that belong to the subroutine starting with the basic block corresponding to this label, and marks these blocks as belonging to this subroutine. This method follows the control flow graph to find all the blocks that are reachable from the current basic block WITHOUT following any jsr target. Note a precondition and postcondition of this method is that all labels must have a null
| |
| pushSuccessors | back to summary |
|---|---|
| private Label pushSuccessors(final Label listOfLabelsToProcess) Adds the successors of this label in the method's control flow graph (except those corresponding to a jsr target, and those already in a list of labels) to the given list of blocks to process, and returns the new list.
| |
| put | back to summary |
|---|---|
| pack-priv final void put(final ByteVector code, final int sourceInsnBytecodeOffset, final boolean wideReference) Puts a reference to this label in the bytecode of a method. If the bytecode offset of the label is known, the relative bytecode offset between the label and the instruction referencing it is computed and written directly. Otherwise, a null relative offset is written and a new forward reference is declared for this label.
| |
| resolve | back to summary |
|---|---|
| pack-priv final boolean resolve(final byte[] code, final int bytecodeOffset) Sets the bytecode offset of this label to the given value and resolves the forward references to this label, if any. This method must be called when this label is added to the bytecode of the method, i.e. when its bytecode offset becomes known. This method fills in the blanks that where left in the bytecode by each forward reference previously added to this label.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this label. | |