OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/pipeline.h" | 5 #include "src/compiler/pipeline.h" |
6 | 6 |
7 #include "src/base/platform/elapsed-timer.h" | 7 #include "src/base/platform/elapsed-timer.h" |
8 #include "src/compiler/ast-graph-builder.h" | 8 #include "src/compiler/ast-graph-builder.h" |
9 #include "src/compiler/code-generator.h" | 9 #include "src/compiler/code-generator.h" |
10 #include "src/compiler/graph-replay.h" | 10 #include "src/compiler/graph-replay.h" |
11 #include "src/compiler/graph-visualizer.h" | 11 #include "src/compiler/graph-visualizer.h" |
12 #include "src/compiler/instruction.h" | 12 #include "src/compiler/instruction.h" |
13 #include "src/compiler/instruction-selector.h" | 13 #include "src/compiler/instruction-selector.h" |
14 #include "src/compiler/js-context-specialization.h" | 14 #include "src/compiler/js-context-specialization.h" |
15 #include "src/compiler/js-generic-lowering.h" | 15 #include "src/compiler/js-generic-lowering.h" |
16 #include "src/compiler/js-typed-lowering.h" | 16 #include "src/compiler/js-typed-lowering.h" |
| 17 #include "src/compiler/phi-reducer.h" |
17 #include "src/compiler/register-allocator.h" | 18 #include "src/compiler/register-allocator.h" |
18 #include "src/compiler/schedule.h" | 19 #include "src/compiler/schedule.h" |
19 #include "src/compiler/scheduler.h" | 20 #include "src/compiler/scheduler.h" |
20 #include "src/compiler/simplified-lowering.h" | 21 #include "src/compiler/simplified-lowering.h" |
21 #include "src/compiler/typer.h" | 22 #include "src/compiler/typer.h" |
22 #include "src/compiler/verifier.h" | 23 #include "src/compiler/verifier.h" |
23 #include "src/hydrogen.h" | 24 #include "src/hydrogen.h" |
24 #include "src/ostreams.h" | 25 #include "src/ostreams.h" |
25 | 26 |
26 namespace v8 { | 27 namespace v8 { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 JSGraph jsgraph(&graph, &common, &typer); | 138 JSGraph jsgraph(&graph, &common, &typer); |
138 Node* context_node; | 139 Node* context_node; |
139 { | 140 { |
140 PhaseStats graph_builder_stats(info(), PhaseStats::CREATE_GRAPH, | 141 PhaseStats graph_builder_stats(info(), PhaseStats::CREATE_GRAPH, |
141 "graph builder"); | 142 "graph builder"); |
142 AstGraphBuilderWithPositions graph_builder(info(), &jsgraph, | 143 AstGraphBuilderWithPositions graph_builder(info(), &jsgraph, |
143 &source_positions); | 144 &source_positions); |
144 graph_builder.CreateGraph(); | 145 graph_builder.CreateGraph(); |
145 context_node = graph_builder.GetFunctionContext(); | 146 context_node = graph_builder.GetFunctionContext(); |
146 } | 147 } |
| 148 { |
| 149 PhaseStats phi_reducer_stats(info(), PhaseStats::CREATE_GRAPH, |
| 150 "phi reduction"); |
| 151 PhiReducer phi_reducer; |
| 152 GraphReducer graph_reducer(&graph); |
| 153 graph_reducer.AddReducer(&phi_reducer); |
| 154 graph_reducer.ReduceGraph(); |
| 155 // TODO(mstarzinger): Running reducer once ought to be enough for everyone. |
| 156 graph_reducer.ReduceGraph(); |
| 157 graph_reducer.ReduceGraph(); |
| 158 } |
147 | 159 |
148 VerifyAndPrintGraph(&graph, "Initial untyped"); | 160 VerifyAndPrintGraph(&graph, "Initial untyped"); |
149 | 161 |
150 if (FLAG_context_specialization) { | 162 if (FLAG_context_specialization) { |
151 SourcePositionTable::Scope pos_(&source_positions, | 163 SourcePositionTable::Scope pos_(&source_positions, |
152 SourcePosition::Unknown()); | 164 SourcePosition::Unknown()); |
153 // Specialize the code to the context as aggressively as possible. | 165 // Specialize the code to the context as aggressively as possible. |
154 JSContextSpecializer spec(info(), &jsgraph, context_node); | 166 JSContextSpecializer spec(info(), &jsgraph, context_node); |
155 spec.SpecializeToContext(); | 167 spec.SpecializeToContext(); |
156 VerifyAndPrintGraph(&graph, "Context specialized"); | 168 VerifyAndPrintGraph(&graph, "Context specialized"); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 } | 315 } |
304 | 316 |
305 | 317 |
306 void Pipeline::TearDown() { | 318 void Pipeline::TearDown() { |
307 InstructionOperand::TearDownCaches(); | 319 InstructionOperand::TearDownCaches(); |
308 } | 320 } |
309 | 321 |
310 } // namespace compiler | 322 } // namespace compiler |
311 } // namespace internal | 323 } // namespace internal |
312 } // namespace v8 | 324 } // namespace v8 |
OLD | NEW |