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

Unified Diff: src/compiler/pipeline.cc

Issue 1198193002: [turbofan] Run context specialization, inlining and initial DCE in one pass. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 5 years, 6 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index 6f55e4c639541ab7aa3ceb3c385ec434e49e5a40..d71ade0ce01fb570f91d5ec5020b4a5254e05372 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -486,27 +486,25 @@ struct GraphBuilderPhase {
};
-struct ContextSpecializerPhase {
- static const char* phase_name() { return "context specializing"; }
-
- void Run(PipelineData* data, Zone* temp_zone) {
- JSGraphReducer graph_reducer(data->jsgraph(), temp_zone);
- JSContextSpecializer spec(&graph_reducer, data->jsgraph());
- AddReducer(data, &graph_reducer, &spec);
- graph_reducer.ReduceGraph();
- }
-};
-
-
struct InliningPhase {
static const char* phase_name() { return "inlining"; }
void Run(PipelineData* data, Zone* temp_zone) {
JSGraphReducer graph_reducer(data->jsgraph(), temp_zone);
+ DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
+ data->common());
+ CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
+ data->common(), data->machine());
+ JSContextSpecializer context_specializer(&graph_reducer, data->jsgraph());
JSInliner inliner(&graph_reducer, data->info()->is_inlining_enabled()
? JSInliner::kGeneralInlining
: JSInliner::kRestrictedInlining,
temp_zone, data->info(), data->jsgraph());
+ AddReducer(data, &graph_reducer, &dead_code_elimination);
+ AddReducer(data, &graph_reducer, &common_reducer);
+ if (data->info()->is_context_specializing()) {
+ AddReducer(data, &graph_reducer, &context_specializer);
+ }
AddReducer(data, &graph_reducer, &inliner);
graph_reducer.ReduceGraph();
}
@@ -637,8 +635,8 @@ struct ChangeLoweringPhase {
};
-struct EarlyControlReductionPhase {
- static const char* phase_name() { return "early control reduction"; }
+struct LateControlReductionPhase {
+ static const char* phase_name() { return "late control reduction"; }
void Run(PipelineData* data, Zone* temp_zone) {
GraphReducer graph_reducer(temp_zone, data->graph());
DeadCodeElimination dce(&graph_reducer, data->graph(), data->common());
@@ -1039,18 +1037,11 @@ Handle<Code> Pipeline::GenerateCode() {
if (data.compilation_failed()) return Handle<Code>::null();
RunPrintAndVerify("Initial untyped", true);
- Run<EarlyControlReductionPhase>();
- RunPrintAndVerify("Early Control reduced", true);
-
- if (info()->is_context_specializing()) {
- // Specialize the code to the context as aggressively as possible.
- Run<ContextSpecializerPhase>();
- RunPrintAndVerify("Context specialized", true);
- }
-
+ // Perform context specialization and inlining (if enabled).
Run<InliningPhase>();
RunPrintAndVerify("Inlined", true);
+ // Remove dead->live edges from the graph.
Run<EarlyGraphTrimmingPhase>();
RunPrintAndVerify("Early trimmed", true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698