Index: src/compiler/pipeline.cc |
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
index 3325d9b0641994504652622d3a45526c13f9ce71..e5d001de021bede95682eec89d93672c1965d503 100644 |
--- a/src/compiler/pipeline.cc |
+++ b/src/compiler/pipeline.cc |
@@ -19,6 +19,8 @@ |
#include "src/compiler/common-operator-reducer.h" |
#include "src/compiler/control-flow-optimizer.h" |
#include "src/compiler/dead-code-elimination.h" |
+#include "src/compiler/escape-analysis.h" |
+#include "src/compiler/escape-analysis-reducer.h" |
#include "src/compiler/frame-elider.h" |
#include "src/compiler/graph-replay.h" |
#include "src/compiler/graph-trimmer.h" |
@@ -623,6 +625,25 @@ struct BranchEliminationPhase { |
}; |
+struct EscapeAnalysisPhase { |
+ static const char* phase_name() { return "escape analysis"; } |
+ |
+ void Run(PipelineData* data, Zone* temp_zone) { |
+ EscapeStatusAnalysis escape_status(data->graph(), temp_zone); |
+ escape_status.Run(); |
+ EscapeObjectAnalysis escape_analysis(data->graph(), |
+ data->jsgraph()->common(), temp_zone); |
+ escape_analysis.Run(); |
+ JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
+ EscapeAnalysisReducer escape_reducer(&graph_reducer, data->jsgraph(), |
+ &escape_status, &escape_analysis, |
+ temp_zone); |
+ AddReducer(data, &graph_reducer, &escape_reducer); |
+ graph_reducer.ReduceGraph(); |
+ } |
+}; |
+ |
+ |
struct SimplifiedLoweringPhase { |
static const char* phase_name() { return "simplified lowering"; } |
@@ -1121,6 +1142,11 @@ Handle<Code> Pipeline::GenerateCode() { |
RunPrintAndVerify("Loop peeled"); |
} |
+ if (FLAG_turbo_escape) { |
+ Run<EscapeAnalysisPhase>(); |
+ RunPrintAndVerify("Escape Analysed"); |
+ } |
+ |
// Lower simplified operators and insert changes. |
Run<SimplifiedLoweringPhase>(); |
RunPrintAndVerify("Lowered simplified"); |