org.jikesrvm.compilers.opt.bc2ir
Class OsrPointConstructor

java.lang.Object
  extended by org.jikesrvm.compilers.opt.driver.CompilerPhase
      extended by org.jikesrvm.compilers.opt.bc2ir.OsrPointConstructor

public class OsrPointConstructor
extends CompilerPhase

A phase in the OPT compiler for construction OsrPoint instructions after inlining.


Field Summary
private  BranchOptimizations branchOpts
          Need to run branch optimizations after
 
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
container
 
Constructor Summary
OsrPointConstructor()
          Constructor
 
Method Summary
private  void adjustBCIndex(Instruction barrier)
          The OsrBarrier instruction is not in IR, so the bc index was not adjusted in OSR_AdjustBCIndex
private  LinkedList<Instruction> collectOsrPoints(IR ir)
          Iterates instructions, build a list of OsrPoint instructions.
private  int countNonVoidTypes(byte[] typeCodes)
           
private  void fixupCFGForOsr(LinkedList<Instruction> osrs, IR ir)
          Split each OsrPoint, and connect it to the exit point.
 String getName()
           
private  boolean isBarrierClean(Instruction barrier)
          verify barrier is clean by checking the number of valid operands
 CompilerPhase newExecution(IR ir)
          Return this instance of this phase.
 void perform(IR ir)
          Goes through each instruction, reconstruct OsrPoint instructions.
private  void removeOsrBarriers(IR ir)
          remove OsrBarrier instructions.
private  void renovateOsrPoints(LinkedList<Instruction> osrs, IR ir)
          For each OsrPoint instruction, traces its OsrBarriers created by inlining. rebuild OsrPoint instruction to hold all necessary information to recover from inlined activation.
 boolean shouldPerform(OptOptions options)
          This method determines if the phase should be run, based on the Options object it is passed.
private  void verifyNoOsrBarriers(IR ir)
           
 
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
dumpIR, dumpIR, getClassConstructor, 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

branchOpts

private final BranchOptimizations branchOpts
Need to run branch optimizations after

Constructor Detail

OsrPointConstructor

public OsrPointConstructor()
Constructor

Method Detail

shouldPerform

public final boolean shouldPerform(OptOptions options)
Description copied from class: CompilerPhase
This method determines if the phase should be run, based on the Options object it is passed. By default, phases are always performed. Subclasses should override this method if they only want to be performed conditionally.

Overrides:
shouldPerform in class CompilerPhase
Parameters:
options - the compiler options for the compilation
Returns:
true if the phase should be performed

newExecution

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

Overrides:
newExecution in class CompilerPhase
Parameters:
ir - not used
Returns:
this

getName

public final String getName()
Specified by:
getName in class CompilerPhase
Returns:
a String which is the name of the phase.

perform

public void perform(IR ir)
Goes through each instruction, reconstruct OsrPoint instructions.

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

collectOsrPoints

private LinkedList<Instruction> collectOsrPoints(IR ir)
Iterates instructions, build a list of OsrPoint instructions.


renovateOsrPoints

private void renovateOsrPoints(LinkedList<Instruction> osrs,
                               IR ir)
For each OsrPoint instruction, traces its OsrBarriers created by inlining. rebuild OsrPoint instruction to hold all necessary information to recover from inlined activation.


adjustBCIndex

private void adjustBCIndex(Instruction barrier)
The OsrBarrier instruction is not in IR, so the bc index was not adjusted in OSR_AdjustBCIndex


removeOsrBarriers

private void removeOsrBarriers(IR ir)
remove OsrBarrier instructions.


verifyNoOsrBarriers

private void verifyNoOsrBarriers(IR ir)

isBarrierClean

private boolean isBarrierClean(Instruction barrier)
verify barrier is clean by checking the number of valid operands


countNonVoidTypes

private int countNonVoidTypes(byte[] typeCodes)

fixupCFGForOsr

private void fixupCFGForOsr(LinkedList<Instruction> osrs,
                            IR ir)
Split each OsrPoint, and connect it to the exit point.