|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.driver.CompilerPhase org.jikesrvm.compilers.opt.escape.SimpleEscape
class SimpleEscape
Simple flow-insensitive escape analysis
TODO: This would be more effective if formulated as a data-flow problem, and solved with iteration
Nested Class Summary | |
---|---|
private static class |
SimpleEscape.AnalysisResult
Utility class used to hold the result of the escape analysis. |
Field Summary | |
---|---|
private static OptimizationPlanElement |
escapePlan
This member represents the directions to the optimizing compiler to perform escape analysis on a method, but do not generate code. |
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
container |
Constructor Summary | |
---|---|
SimpleEscape()
|
Method Summary | |
---|---|
private static SimpleEscape.AnalysisResult |
checkAllAppearances(Register reg,
IR ir)
Check all appearances of a register, to see if any object pointed to by this register may escape this thread and/or method. |
private static boolean |
checkEscapesMethod(RegisterOperand use,
IR ir,
Set<Register> visited)
Check a single use, to see if this use may cause the object referenced to escape from this method. |
private static boolean |
checkEscapesThread(RegisterOperand use,
IR ir,
Set<Register> visited)
Check a single use, to see if this use may cause the object referenced to escape from this thread. |
private static boolean |
checkIfUseEscapesMethod(Register reg,
IR ir,
Set<Register> visited)
|
private static boolean |
checkIfUseEscapesThread(Register reg,
IR ir,
Set<Register> visited)
|
private static MethodSummary |
findOrCreateMethodSummary(RVMMethod m,
OptOptions options)
If a method summary exists for a method, get it. |
String |
getName()
|
private static int |
getParameterIndex(Operand op,
Instruction s)
Which parameter to a call instruction corresponds to op? |
private static OptimizationPlanElement |
initEscapePlan()
Static initializer: set up the compilation plan for simple escape analysis of a method. |
private static Iterator<Operand> |
iterateReturnValues(IR ir)
Return an iterator over the operands that serve as return values in an IR TODO: Move this utility elsewhere |
CompilerPhase |
newExecution(IR ir)
Return this instance of this phase. |
void |
perform(IR ir)
This is the method that actually does the work of the phase. |
private static void |
performSimpleEscapeAnalysis(RVMMethod m,
OptOptions options)
Perform the simple escape analysis for a method. |
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. |
FI_EscapeSummary |
simpleEscapeAnalysis(IR ir)
Perform the escape analysis for a method. |
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 |
---|
private static final OptimizationPlanElement escapePlan
Constructor Detail |
---|
SimpleEscape()
Method Detail |
---|
public CompilerPhase newExecution(IR ir)
newExecution
in class CompilerPhase
ir
- not used
public final boolean shouldPerform(OptOptions options)
CompilerPhase
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilation
public final String getName()
getName
in class CompilerPhase
public final boolean printingEnabled(OptOptions options, boolean before)
CompilerPhase
printingEnabled
in class CompilerPhase
options
- the compiler options for the compilationbefore
- true when invoked before perform, false otherwise.
public void perform(IR ir)
CompilerPhase
perform
in class CompilerPhase
ir
- the IR on which to apply the phasepublic FI_EscapeSummary simpleEscapeAnalysis(IR ir)
Side effect: updates method summary database to hold escape analysis result for parameters
ir
- IR for the target methodprivate static SimpleEscape.AnalysisResult checkAllAppearances(Register reg, IR ir)
reg
- the register to checkir
- the governing IR
private static boolean checkIfUseEscapesThread(Register reg, IR ir, Set<Register> visited)
private static boolean checkIfUseEscapesMethod(Register reg, IR ir, Set<Register> visited)
private static boolean checkEscapesThread(RegisterOperand use, IR ir, Set<Register> visited)
use
- the use to checkir
- the governing IR
true
if it may escape, false
otherwiseprivate static boolean checkEscapesMethod(RegisterOperand use, IR ir, Set<Register> visited)
use
- the use to checkir
- the governing IR
private static int getParameterIndex(Operand op, Instruction s)
PRECONDITION: Call.conforms(s)
private static MethodSummary findOrCreateMethodSummary(RVMMethod m, OptOptions options)
private static void performSimpleEscapeAnalysis(RVMMethod m, OptOptions options)
private static OptimizationPlanElement initEscapePlan()
private static Iterator<Operand> iterateReturnValues(IR ir)
TODO: Move this utility elsewhere
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |