org.jikesrvm.compilers.opt.escape
Class EscapeTransformations

java.lang.Object
  extended by org.jikesrvm.compilers.opt.driver.CompilerPhase
      extended by org.jikesrvm.compilers.opt.escape.EscapeTransformations

public class EscapeTransformations
extends CompilerPhase

Transformations that use escape analysis.


Field Summary
private static OptimizationPlanElement escapeCleanUp
          Transforms to clean the IR prior to another round of escape transformations
 
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
container
 
Constructor Summary
EscapeTransformations()
           
 
Method Summary
private  AggregateReplacer getAggregateReplacer(Instruction inst, IR ir)
          Generate an object which will perform scalar replacement of an aggregate allocated by a given instruction PRECONDITION: objects returned by this allocation site do NOT escape the current method
 String getName()
           
private  UnsyncReplacer getUnsyncReplacer(Register reg, Instruction inst, IR ir)
          Generate an object which transforms defs & uses of "synchronized" objects to defs & uses of "unsynchronized" objects PRECONDITION: objects pointed to by reg do NOT escape
 CompilerPhase newExecution(IR ir)
          Return this instance of this phase.
 void perform(IR ir)
          Perform the transformations
 boolean printingEnabled(OptOptions options, boolean before)
          Returns true if the phase wants the IR dumped before and/or after it runs.
 boolean shouldPerform(OptOptions options)
          This method determines if the phase should be run, based on the Options object it is passed.
private static boolean synchronizesOn(IR ir, Register r)
          Is there an instruction in this IR which causes synchronization on an object pointed to by a particular register?
 
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, reportAdditionalStats, setContainer, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

escapeCleanUp

private static final OptimizationPlanElement escapeCleanUp
Transforms to clean the IR prior to another round of escape transformations

Constructor Detail

EscapeTransformations

public EscapeTransformations()
Method Detail

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

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

getName

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

printingEnabled

public final boolean printingEnabled(OptOptions options,
                                     boolean before)
Description copied from class: CompilerPhase
Returns true if the phase wants the IR dumped before and/or after it runs. By default, printing is not enabled. Subclasses should override this method if they want to provide IR dumping.

Overrides:
printingEnabled in class CompilerPhase
Parameters:
options - the compiler options for the compilation
before - true when invoked before perform, false otherwise.
Returns:
true if the IR should be printed, false otherwise.

perform

public void perform(IR ir)
Perform the transformations

Specified by:
perform in class CompilerPhase
Parameters:
ir - IR for the target method

getUnsyncReplacer

private UnsyncReplacer getUnsyncReplacer(Register reg,
                                         Instruction inst,
                                         IR ir)
Generate an object which transforms defs & uses of "synchronized" objects to defs & uses of "unsynchronized" objects

PRECONDITION: objects pointed to by reg do NOT escape

Parameters:
reg - the pointer whose defs and uses should be transformed
inst - the allocation site
ir - controlling ir
Returns:
an UnsyncReplacer specialized to the allocation site, null if no legal transformation found

synchronizesOn

private static boolean synchronizesOn(IR ir,
                                      Register r)
Is there an instruction in this IR which causes synchronization on an object pointed to by a particular register? PRECONDITION: register lists computed and valid


getAggregateReplacer

private AggregateReplacer getAggregateReplacer(Instruction inst,
                                               IR ir)
Generate an object which will perform scalar replacement of an aggregate allocated by a given instruction

PRECONDITION: objects returned by this allocation site do NOT escape the current method

Parameters:
inst - the allocation site
ir - controlling ir
Returns:
an AggregateReplacer specialized to the allocation site, null if no legal transformation found