Package mockit.asm.controlFlow
Class Label
java.lang.Object
mockit.asm.controlFlow.Label
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. A label designates the instruction that is just after. Note however that there can
be other elements between a label and the instruction it designates (such as other labels, stack map frames, line
numbers, etc.).
-
Field Summary
FieldsModifier and TypeFieldDescription@org.checkerframework.checker.index.qual.NonNegative int
Line number of label which is the target of a JMP instruction.@org.checkerframework.checker.index.qual.NonNegative int
The line number corresponding to this label, if known.@org.checkerframework.checker.index.qual.NonNegative int
The position of this label in the code, if known. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFirst()
Returns the first label of the series to which this label belongs.getFrame()
Returns theframe
this basic block belongs to, if any.Returns this label'ssuccessor
, if any.boolean
isDebug()
boolean
boolean
boolean
boolean
isTarget()
void
void
void
put
(ByteVector out, @org.checkerframework.checker.index.qual.NonNegative int source, boolean wideOffset) Puts a reference to this label in the bytecode of a method.setSuccessors
(Edge edge) toString()
-
Field Details
-
line
public @org.checkerframework.checker.index.qual.NonNegative int lineThe line number corresponding to this label, if known. -
jumpTargetLine
public @org.checkerframework.checker.index.qual.NonNegative int jumpTargetLineLine number of label which is the target of a JMP instruction. -
position
public @org.checkerframework.checker.index.qual.NonNegative int positionThe position of this label in the code, if known.
-
-
Constructor Details
-
Label
public Label()
-
-
Method Details
-
getFrame
Returns theframe
this basic block belongs to, if any. -
isDebug
public boolean isDebug() -
isResolved
public boolean isResolved() -
isTarget
public boolean isTarget() -
isStoringFrame
public boolean isStoringFrame() -
isReachable
public boolean isReachable() -
markAsDebug
public void markAsDebug() -
markAsTarget
public void markAsTarget() -
put
public void put(@NonNull ByteVector out, @org.checkerframework.checker.index.qual.NonNegative int source, boolean wideOffset) 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:
out
- the bytecode of the methodsource
- the position of first byte of the bytecode instruction that contains this labelwideOffset
-true
if the reference must be stored in 4 bytes, orfalse
if it must be stored with 2 bytes- Throws:
IllegalArgumentException
- if this label has not been created by the given code writer
-
getFirst
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, returns the label itself. For other labels, returns the first label of the series.- Returns:
- the first label of the series to which this label belongs
-
getSuccessor
Returns this label'ssuccessor
, if any. -
setSuccessors
-
toString
-