Index: src/compiler/pipeline.cc |
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
index 9256e5882d41f9dda1a12c16784a24013d62e0b4..8890f80f501b9fe56c3462fcb6d6aee644feaadf 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" |
@@ -646,6 +648,26 @@ struct BranchEliminationPhase { |
}; |
+struct EscapeAnalysisPhase { |
+ static const char* phase_name() { return "escape analysis"; } |
+ |
+ void Run(PipelineData* data, Zone* temp_zone) { |
+ EscapeObjectAnalysis escape_analysis(data->graph(), |
+ data->jsgraph()->common(), temp_zone); |
+ escape_analysis.Run(); |
+ EscapeStatusAnalysis escape_status(&escape_analysis, data->graph(), |
+ temp_zone); |
+ escape_status.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"; } |
@@ -1148,6 +1170,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"); |