org.jikesrvm.compilers.opt.controlflow
Class YieldPoints

java.lang.Object
  extended by org.jikesrvm.compilers.opt.driver.CompilerPhase
      extended by org.jikesrvm.compilers.opt.controlflow.YieldPoints

public class YieldPoints
extends CompilerPhase

This class inserts yield points in


Field Summary
 
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
container
 
Constructor Summary
YieldPoints()
           
 
Method Summary
 String getName()
          Return the name of this phase
 CompilerPhase newExecution(IR ir)
          This phase contains no per-compilation instance fields.
 void perform(IR ir)
          Insert yield points in method prologues, loop heads, and method exits
private  void prependYield(BasicBlock bb, Operator yp, int bcIndex, InlineSequence position)
          Add a YIELD instruction to the appropriate place for the basic block passed.
private  void processLoopNest(LSTNode n)
          Process all loop heads in a loop nest by inserting a backedge yieldpoint in each of them.
 
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, printingEnabled, reportAdditionalStats, setContainer, shouldPerform, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YieldPoints

public YieldPoints()
Method Detail

getName

public final String getName()
Return the name of this phase

Specified by:
getName in class CompilerPhase
Returns:
"Yield Point Insertion"

newExecution

public final CompilerPhase newExecution(IR ir)
This phase contains no per-compilation instance fields.

Overrides:
newExecution in class CompilerPhase
Parameters:
ir - the IR that is about to be passed to performPhase
Returns:
an opt compiler phase on which performPhase may be invoked.

perform

public final void perform(IR ir)
Insert yield points in method prologues, loop heads, and method exits

Specified by:
perform in class CompilerPhase
Parameters:
ir - the IR on which to apply the phase

processLoopNest

private void processLoopNest(LSTNode n)
Process all loop heads in a loop nest by inserting a backedge yieldpoint in each of them.


prependYield

private void prependYield(BasicBlock bb,
                          Operator yp,
                          int bcIndex,
                          InlineSequence position)
Add a YIELD instruction to the appropriate place for the basic block passed.

Parameters:
bb - the basic block
yp - the yieldpoint operator to insert
bcIndex - the bcIndex of the yieldpoint
position - the source position of the yieldpoint