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/change-lowering.h" | 9 #include "src/compiler/change-lowering.h" |
10 #include "src/compiler/code-generator.h" | 10 #include "src/compiler/code-generator.h" |
11 #include "src/compiler/graph-replay.h" | 11 #include "src/compiler/graph-replay.h" |
12 #include "src/compiler/graph-visualizer.h" | 12 #include "src/compiler/graph-visualizer.h" |
13 #include "src/compiler/instruction.h" | 13 #include "src/compiler/instruction.h" |
14 #include "src/compiler/instruction-selector.h" | 14 #include "src/compiler/instruction-selector.h" |
15 #include "src/compiler/js-context-specialization.h" | 15 #include "src/compiler/js-context-specialization.h" |
16 #include "src/compiler/js-generic-lowering.h" | 16 #include "src/compiler/js-generic-lowering.h" |
17 #include "src/compiler/js-inlining.h" | 17 #include "src/compiler/js-inlining.h" |
18 #include "src/compiler/js-typed-lowering.h" | 18 #include "src/compiler/js-typed-lowering.h" |
| 19 #include "src/compiler/machine-operator-reducer.h" |
19 #include "src/compiler/phi-reducer.h" | 20 #include "src/compiler/phi-reducer.h" |
20 #include "src/compiler/register-allocator.h" | 21 #include "src/compiler/register-allocator.h" |
21 #include "src/compiler/schedule.h" | 22 #include "src/compiler/schedule.h" |
22 #include "src/compiler/scheduler.h" | 23 #include "src/compiler/scheduler.h" |
23 #include "src/compiler/simplified-lowering.h" | 24 #include "src/compiler/simplified-lowering.h" |
| 25 #include "src/compiler/simplified-operator-reducer.h" |
24 #include "src/compiler/typer.h" | 26 #include "src/compiler/typer.h" |
25 #include "src/compiler/verifier.h" | 27 #include "src/compiler/verifier.h" |
26 #include "src/hydrogen.h" | 28 #include "src/hydrogen.h" |
27 #include "src/ostreams.h" | 29 #include "src/ostreams.h" |
28 #include "src/utils.h" | 30 #include "src/utils.h" |
29 | 31 |
30 namespace v8 { | 32 namespace v8 { |
31 namespace internal { | 33 namespace internal { |
32 namespace compiler { | 34 namespace compiler { |
33 | 35 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 "simplified lowering"); | 242 "simplified lowering"); |
241 SourcePositionTable::Scope pos(&source_positions, | 243 SourcePositionTable::Scope pos(&source_positions, |
242 SourcePosition::Unknown()); | 244 SourcePosition::Unknown()); |
243 SimplifiedLowering lowering(&jsgraph); | 245 SimplifiedLowering lowering(&jsgraph); |
244 lowering.LowerAllNodes(); | 246 lowering.LowerAllNodes(); |
245 | 247 |
246 VerifyAndPrintGraph(&graph, "Lowered simplified"); | 248 VerifyAndPrintGraph(&graph, "Lowered simplified"); |
247 } | 249 } |
248 { | 250 { |
249 // Lower changes that have been inserted before. | 251 // Lower changes that have been inserted before. |
250 PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH, | 252 PhaseStats lowering_stats(info(), PhaseStats::OPTIMIZATION, |
251 "change lowering"); | 253 "change lowering"); |
252 SourcePositionTable::Scope pos(&source_positions, | 254 SourcePositionTable::Scope pos(&source_positions, |
253 SourcePosition::Unknown()); | 255 SourcePosition::Unknown()); |
254 Linkage linkage(info()); | 256 Linkage linkage(info()); |
255 MachineOperatorBuilder machine(zone()); | 257 MachineOperatorBuilder machine(zone()); |
| 258 SimplifiedOperatorReducer simple_reducer(&jsgraph, &machine); |
256 ChangeLowering lowering(&jsgraph, &linkage, &machine); | 259 ChangeLowering lowering(&jsgraph, &linkage, &machine); |
| 260 MachineOperatorReducer mach_reducer(&graph); |
257 GraphReducer graph_reducer(&graph); | 261 GraphReducer graph_reducer(&graph); |
| 262 // TODO(titzer): Figure out if we should run all reducers at once here. |
| 263 graph_reducer.AddReducer(&simple_reducer); |
258 graph_reducer.AddReducer(&lowering); | 264 graph_reducer.AddReducer(&lowering); |
| 265 graph_reducer.AddReducer(&mach_reducer); |
259 graph_reducer.ReduceGraph(); | 266 graph_reducer.ReduceGraph(); |
260 | 267 |
261 VerifyAndPrintGraph(&graph, "Lowered changes"); | 268 VerifyAndPrintGraph(&graph, "Lowered changes"); |
262 } | 269 } |
263 } | 270 } |
264 | 271 |
265 Handle<Code> code = Handle<Code>::null(); | 272 Handle<Code> code = Handle<Code>::null(); |
266 if (SupportedTarget()) { | 273 if (SupportedTarget()) { |
267 { | 274 { |
268 // Lower any remaining generic JSOperators. | 275 // Lower any remaining generic JSOperators. |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 } | 397 } |
391 | 398 |
392 | 399 |
393 void Pipeline::TearDown() { | 400 void Pipeline::TearDown() { |
394 InstructionOperand::TearDownCaches(); | 401 InstructionOperand::TearDownCaches(); |
395 } | 402 } |
396 | 403 |
397 } // namespace compiler | 404 } // namespace compiler |
398 } // namespace internal | 405 } // namespace internal |
399 } // namespace v8 | 406 } // namespace v8 |
OLD | NEW |