A label represents a position in the bytecode of a method. Labels are used
for jump, goto, and switch instructions, and for try catch blocks.
|static final int ||DEBUG ||Indicates if this 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). |
|static final int ||RESOLVED ||Indicates if the position of this label is known. |
|static final int ||RESIZED ||Indicates if this label has been updated, after instruction resizing. |
|static final int ||PUSHED ||Indicates if this basic block has been pushed in the basic block stack.
See visitMaxs . |
|static final int ||TARGET ||Indicates if this label is the target of a jump instruction, or the start
of an exception handler. |
|static final int ||STORE ||Indicates if a stack map frame must be stored for this label. |
|static final int ||REACHABLE ||Indicates if this label corresponds to a reachable basic block. |
|static final int ||JSR ||Indicates if this basic block ends with a JSR instruction. |
|static final int ||RET ||Indicates if this basic block ends with a RET instruction. |
|static final int ||SUBROUTINE ||Indicates if this basic block is the start of a subroutine. |
|static final int ||VISITED ||Indicates if this subroutine basic block has been visited. |
|public Object ||info ||Field used to associate user information to a 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 org.objectweb.asm.tree.MethodNode#getLabelNode method. |
| int ||status ||Flags that indicate the status of this label. |
| int ||line ||The line number corresponding to this label, if known. |
| int ||position ||The position of this label in the code, if known. |
| int ||inputStackTop ||Start of the output stack relatively to the input stack. The exact
semantics of this field depends on the algorithm that is used.
When only the maximum stack size is computed, this field is the number of
elements in the input stack.
When the stack map frames are completely computed, this field is the
offset of the first output stack element relatively to the top of the
input stack. This offset is always negative or null. A null offset means
that the output stack must be appended to the input stack. A -n offset
means that the first n output stack elements must replace the top n input
stack elements, and that the other elements must be appended to the input
| int ||outputStackMax ||Maximum height reached by the output stack, relatively to the top of the
input stack. This maximum is always positive or null. |
| Frame ||frame ||Information about the input and output stack map frames of this basic
block. This field is only used when ClassWriter#COMPUTE_FRAMES
option is used. |
| Label ||successor ||The successor of this label, in the order they are visited. This linked
list does not include labels used for debug info only. If
ClassWriter#COMPUTE_FRAMES option is used then, in addition, it
does not contain successive labels that denote the same bytecode position
(in this case only the first label appears in this list). |
| Edge ||successors ||The successors of this node in the control flow graph. These successors
are stored in a linked list of Edge objects, linked to each
other by their Edge#next field. |
| Label ||next ||The next basic block in the basic block stack. This stack is used in the
main loop of the fix point algorithm used in the second step of the
control flow analysis algorithms.|
|Method from org.objectweb.asm.Label Detail:|
void addToSubroutine(long id,
Marks this basic block as belonging to the given subroutine.
Returns the first label of the series to which this label belongs. For an
isolated label or for the first label in a series of successive labels,
this method returns the label itself. For other labels it returns the
first label of the series.
public int getOffset()
Returns the offset corresponding to this label. This offset is computed
from the start of the method's bytecode. This method is intended for
Attribute sub classes, and is normally not needed by class
generators or adapters.
boolean inSameSubroutine(Label block)
Returns true if this basic block and the given one belong to a common
boolean inSubroutine(long id)
Returns true is this basic block belongs to the given subroutine.
void put(MethodWriter owner,
Puts a reference to this label in the bytecode of a method. If the
position of the label is known, the offset is computed and written
directly. Otherwise, a null offset is written and a new forward reference
is declared for this label.
boolean resolve(MethodWriter owner,
Resolves all forward references to this label. This method must be called
when this label is added to the bytecode of the method, i.e. when its
position becomes known. This method fills in the blanks that where left
in the bytecode by each forward reference previously added to this label.
public String toString()
Returns a string representation of this label.
void visitSubroutine(Label JSR,
Finds the basic blocks that belong to a given subroutine, and marks these
blocks as belonging to this subroutine. This recursive method follows the
control flow graph to find all the blocks that are reachable from the
current block WITHOUT following any JSR target.