| java.lang.Object bsh.org.objectweb.asm.Label
Label | public class Label (Code) | | 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.
|
Field Summary | |
int | beginStackSize The stack size at the beginning of this basic block.
This size is initially unknown. | int | maxStackSize The (relative) maximum stack size corresponding to this basic block. | Label | next The next basic block in the basic block stack. | CodeWriter | owner The code writer to which this label belongs, or null if unknown. | int | position The position of this label in the code, if known. | boolean | pushed true if this basic block has been pushed in the basic block stack. | boolean | resolved Indicates if the position of this label is known. | Edge | successors The successors of this node in the control flow graph. |
Constructor Summary | |
public | Label() Constructs a new label. |
Method Summary | |
void | put(CodeWriter owner, ByteVector out, int source, boolean wideOffset) Puts a reference to this label in the bytecode of a method. | boolean | resolve(CodeWriter owner, int position, byte[] data) Resolves all forward references to this label. |
beginStackSize | int beginStackSize(Code) | | The stack size at the beginning of this basic block.
This size is initially unknown. It is computed by the control flow
analysis algorithm (see
CodeWriter.visitMaxs visitMaxs ).
|
maxStackSize | int maxStackSize(Code) | | The (relative) maximum stack size corresponding to this basic block. This
size is relative to the stack size at the beginning of the basic block,
i.e., the true maximum stack size is equal to
Label.beginStackSizebeginStackSize +
Label.maxStackSize maxStackSize .
|
owner | CodeWriter owner(Code) | | The code writer to which this label belongs, or null if unknown.
|
position | int position(Code) | | The position of this label in the code, if known.
|
pushed | boolean pushed(Code) | | true if this basic block has been pushed in the basic block stack.
See
CodeWriter.visitMaxs visitMaxs .
|
resolved | boolean resolved(Code) | | Indicates if the position of this label is known.
|
successors | Edge successors(Code) | | The successors of this node in the control flow graph. These successors
are stored in a linked list of
Edge Edge objects, linked to each
other by their
Edge.next field.
|
Label | public Label()(Code) | | Constructs a new label.
|
put | void put(CodeWriter owner, ByteVector out, int source, boolean wideOffset)(Code) | | 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.
Parameters: owner - the code writer that calls this method. Parameters: out - the bytecode of the method. Parameters: source - the position of first byte of the bytecode instruction thatcontains this label. Parameters: wideOffset - true if the reference must be stored in 4 bytes,or false if it must be stored with 2 bytes. throws: IllegalArgumentException - if this label has not been created by thegiven code writer. |
resolve | boolean resolve(CodeWriter owner, int position, byte[] data)(Code) | | 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.
Parameters: owner - the code writer that calls this method. Parameters: position - the position of this label in the bytecode. Parameters: data - the bytecode of the method. true if a blank that was left for this label was to smallto store the offset. In such a case the corresponding jump instructionis replaced with a pseudo instruction (using unused opcodes) using anunsigned two bytes offset. These pseudo instructions will need to bereplaced with true instructions with wider offsets (4 bytes instead of2). This is done in CodeWriter.resizeInstructions. throws: IllegalArgumentException - if this label has already been resolved,or if it has not been created by the given code writer. |
|
|