public class Label
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static int |
DEBUG
Indicates if this label is only used for debug attributes.
|
(package private) Frame |
frame
Information about the input and output stack map frames of this basic
block.
|
java.lang.Object |
info
Field used to associate user information to a label.
|
(package private) int |
inputStackTop
Start of the output stack relatively to the input stack.
|
(package private) static int |
JSR
Indicates if this basic block ends with a JSR instruction.
|
(package private) int |
line
The line number corresponding to this label, if known.
|
(package private) Label |
next
The next basic block in the basic block stack.
|
(package private) int |
outputStackMax
Maximum height reached by the output stack, relatively to the top of the
input stack.
|
(package private) int |
position
The position of this label in the code, if known.
|
(package private) static int |
PUSHED
Indicates if this basic block has been pushed in the basic block stack.
|
(package private) static int |
REACHABLE
Indicates if this label corresponds to a reachable basic block.
|
private int |
referenceCount
Number of forward references to this label, times two.
|
(package private) static int |
RESIZED
Indicates if this label has been updated, after instruction resizing.
|
(package private) static int |
RESOLVED
Indicates if the position of this label is known.
|
(package private) static int |
RET
Indicates if this basic block ends with a RET instruction.
|
private int[] |
srcAndRefPositions
Informations about forward references.
|
(package private) int |
status
Flags that indicate the status of this label.
|
(package private) static int |
STORE
Indicates if a stack map frame must be stored for this label.
|
(package private) Label |
successor
The successor of this label, in the order they are visited.
|
(package private) Edge |
successors
The successors of this node in the control flow graph.
|
(package private) static int |
TARGET
Indicates if this label is the target of a jump instruction, or the start
of an exception handler.
|
Constructor and Description |
---|
Label()
Constructs a new label.
|
Label(boolean debug)
Constructs a new label.
|
Modifier and Type | Method and Description |
---|---|
private void |
addReference(int sourcePosition,
int referencePosition)
Adds a forward reference to this label.
|
(package private) Label |
getFirst()
Returns the first label of the series to which this label belongs.
|
int |
getOffset()
Returns the offset corresponding to this label.
|
(package private) void |
put(MethodWriter owner,
ByteVector out,
int source,
boolean wideOffset)
Puts a reference to this label in the bytecode of a method.
|
(package private) boolean |
resolve(MethodWriter owner,
int position,
byte[] data)
Resolves all forward references to this label.
|
java.lang.String |
toString()
Returns a string representation of this label.
|
static final int DEBUG
static final int RESOLVED
static final int RESIZED
static final int PUSHED
visitMaxs
.static final int TARGET
static final int STORE
static final int REACHABLE
static final int JSR
static final int RET
public java.lang.Object info
int status
int line
int position
private int referenceCount
private int[] srcAndRefPositions
int inputStackTop
int outputStackMax
Frame frame
ClassWriter.COMPUTE_FRAMES
option is used.Label successor
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
Label next
MethodWriter.visitMaxs(int, int)
public Label()
Label(boolean debug)
debug
- if this label is only used for debug attributes.public int getOffset()
Attribute
sub classes, and is normally not needed by class
generators or adapters.java.lang.IllegalStateException
- if this label is not resolved yet.void put(MethodWriter owner, ByteVector out, int source, boolean wideOffset)
owner
- the code writer that calls this method.out
- the bytecode of the method.source
- the position of first byte of the bytecode instruction that
contains this label.wideOffset
- true if the reference must be stored in 4
bytes, or false if it must be stored with 2 bytes.java.lang.IllegalArgumentException
- if this label has not been created by
the given code writer.private void addReference(int sourcePosition, int referencePosition)
sourcePosition
- the position of the referencing instruction. This
position will be used to compute the offset of this forward
reference.referencePosition
- the position where the offset for this forward
reference must be stored.boolean resolve(MethodWriter owner, int position, byte[] data)
owner
- the code writer that calls this method.position
- the position of this label in the bytecode.data
- the bytecode of the method.MethodWriter.resizeInstructions()
.java.lang.IllegalArgumentException
- if this label has already been resolved,
or if it has not been created by the given code writer.Label getFirst()
public java.lang.String toString()
toString
in class java.lang.Object