|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jikesrvm.compilers.opt.driver.CompilerPhase
org.jikesrvm.compilers.opt.controlflow.TailRecursionElimination
public final class TailRecursionElimination
Transform tail recursive calls into loops.
NOTES:
| Field Summary | |
|---|---|
private BranchOptimizations |
branchOpts
|
private static Constructor<CompilerPhase> |
constructor
Constructor for this compiler phase |
private static boolean |
DEBUG
|
| Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
|---|
container |
| Constructor Summary | |
|---|---|
TailRecursionElimination()
|
|
| Method Summary | |
|---|---|
Constructor<CompilerPhase> |
getClassConstructor()
Get a constructor object for this compiler phase |
String |
getName()
|
(package private) boolean |
isTailRecursion(Instruction call,
IR ir)
Is the argument call instruction a tail recursive call? |
CompilerPhase |
newExecution(IR ir)
This method is called immediately before performPhase. |
void |
perform(IR ir)
Perform tail recursion elimination. |
boolean |
shouldPerform(OptOptions options)
This method determines if the phase should be run, based on the Options object it is passed. |
(package private) Instruction |
transform(Instruction call,
Instruction prologue,
BasicBlock target,
IR ir)
Transform the tail recursive call into a loop. |
| Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
|---|
dumpIR, dumpIR, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, printingEnabled, reportAdditionalStats, setContainer, verify |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final boolean DEBUG
private final BranchOptimizations branchOpts
private static final Constructor<CompilerPhase> constructor
| Constructor Detail |
|---|
public TailRecursionElimination()
| Method Detail |
|---|
public Constructor<CompilerPhase> getClassConstructor()
getClassConstructor in class CompilerPhasepublic boolean shouldPerform(OptOptions options)
CompilerPhase
shouldPerform in class CompilerPhaseoptions - the compiler options for the compilation
public String getName()
getName in class CompilerPhasepublic CompilerPhase newExecution(IR ir)
CompilerPhase
newExecution in class CompilerPhaseir - the IR that is about to be passed to performPhase
public void perform(IR ir)
perform in class CompilerPhaseir - the IR to optimize
boolean isTailRecursion(Instruction call,
IR ir)
call - the call in questionir - the enclosing IR
true if call is tail recursive and
false if it is not.
Instruction transform(Instruction call,
Instruction prologue,
BasicBlock target,
IR ir)
call - The recursive callprologue - The IR_Prologue instructiontarget - The loop headir - the containing IR
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||