Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: src/compiler/pipeline.cc

Issue 1457683003: [turbofan] Initial support for escape analysis. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index 3325d9b0641994504652622d3a45526c13f9ce71..da68b7bc2332dc68df9f9ba73513f6ebdc557f89 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) {
+ if (!FLAG_turbo_escape) return;
Michael Starzinger 2015/11/30 10:05:39 nit: Better hoist the flag check out to the call-s
sigurds 2015/11/30 13:50:24 Done.
+ 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 red(&graph_reducer, data->jsgraph(), &escape_status,
Michael Starzinger 2015/11/30 10:05:39 nit: s/red/escape_reducer/
sigurds 2015/11/30 13:50:24 Done.
+ &escape_analysis, temp_zone);
+ AddReducer(data, &graph_reducer, &red);
+ graph_reducer.ReduceGraph();
+ }
+};
+
+
struct SimplifiedLoweringPhase {
static const char* phase_name() { return "simplified lowering"; }
@@ -1121,6 +1142,9 @@ Handle<Code> Pipeline::GenerateCode() {
RunPrintAndVerify("Loop peeled");
}
+ Run<EscapeAnalysisPhase>();
+ RunPrintAndVerify("Escape Analysed");
+
// Lower simplified operators and insert changes.
Run<SimplifiedLoweringPhase>();
RunPrintAndVerify("Lowered simplified");

Powered by Google App Engine
This is Rietveld 408576698