|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jikesrvm.compilers.common.assembler.ForwardReference
public abstract class ForwardReference
A forward reference has a machine-code-index source and optionally a bytecode-index target. The idea is to fix up the instruction at the source when the machine-code-index of the target is known. There need not be an explicit target, if the reference is used (by the compiler) within the machine-code for one bytecode. There are three kinds of forward reference: 1) unconditional branches 2) conditional branches 3) switch cases Each subclass must be able to resolve itself. This class also includes the machinery for maintaining a priority queue of forward references, priorities being target bytecode addresses. The head of this priority queue is maintained by a Assembler object. The priority queue is implemented as a one-way linked list of forward references with strictly increasing targets. The link for this list is "next". A separate linked list ("other" is the link) contains all forward references with the same target.
| Nested Class Summary | |
|---|---|
static class |
ForwardReference.ConditionalBranch
|
static class |
ForwardReference.LoadReturnAddress
|
static class |
ForwardReference.ShortBranch
|
static class |
ForwardReference.SwitchCase
|
static class |
ForwardReference.UnconditionalBranch
|
| Field Summary | |
|---|---|
(package private) ForwardReference |
next
Has next larger targetBytecodeIndex |
(package private) ForwardReference |
other
Has the same targetBytecodeIndex |
(package private) int |
sourceMachinecodeIndex
|
(package private) int |
targetBytecodeIndex
|
| Constructor Summary | |
|---|---|
protected |
ForwardReference(int source)
No target; for use within cases of the main compiler loop |
protected |
ForwardReference(int source,
int btarget)
|
| Method Summary | |
|---|---|
static ForwardReference |
enqueue(ForwardReference q,
ForwardReference r)
Add a new reference r to a priority queue q |
abstract void |
resolve(AbstractAssembler asm)
Rewrite source to reference current machine code (in asm's machineCodes) |
static ForwardReference |
resolveMatching(AbstractAssembler asm,
ForwardReference q,
int bi)
Resolve any forward references on priority queue q to bytecode index bi |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final int sourceMachinecodeIndex
final int targetBytecodeIndex
ForwardReference next
ForwardReference other
| Constructor Detail |
|---|
protected ForwardReference(int source,
int btarget)
protected ForwardReference(int source)
| Method Detail |
|---|
public abstract void resolve(AbstractAssembler asm)
public static ForwardReference enqueue(ForwardReference q,
ForwardReference r)
public static ForwardReference resolveMatching(AbstractAssembler asm,
ForwardReference q,
int bi)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||