public final class LabelRef extends Object
StandardOp.JumpOp and StandardOp.BranchOp need to reference their target
AbstractBlockBase. However, direct references are not possible since the control flow
graph (and therefore successors lists) can be changed by optimizations - and fixing the
instructions is error prone. Therefore, we represent an edge to block B from block A via the
tuple (A,
successor-index-of-B). That is, indirectly by storing the index into the successor list of A.
Note therefore that the successor list cannot be re-ordered.| Modifier and Type | Method and Description |
|---|---|
static LabelRef |
forSuccessor(LIR lir,
AbstractBlockBase<?> block,
int suxIndex)
Returns a new reference to a successor of the given block.
|
AbstractBlockBase<?> |
getSourceBlock() |
AbstractBlockBase<?> |
getTargetBlock() |
Label |
label() |
String |
toString() |
public static LabelRef forSuccessor(LIR lir, AbstractBlockBase<?> block, int suxIndex)
block - The base block that contains the successor list.suxIndex - The index of the successor.public AbstractBlockBase<?> getSourceBlock()
public AbstractBlockBase<?> getTargetBlock()
public Label label()