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 <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/base/platform/elapsed-timer.h" | 10 #include "src/base/platform/elapsed-timer.h" |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 struct SimplifiedLoweringPhase { | 435 struct SimplifiedLoweringPhase { |
436 static const char* phase_name() { return "simplified lowering"; } | 436 static const char* phase_name() { return "simplified lowering"; } |
437 | 437 |
438 void Run(PipelineData* data, Zone* temp_zone) { | 438 void Run(PipelineData* data, Zone* temp_zone) { |
439 SourcePositionTable::Scope pos(data->source_positions(), | 439 SourcePositionTable::Scope pos(data->source_positions(), |
440 SourcePosition::Unknown()); | 440 SourcePosition::Unknown()); |
441 SimplifiedLowering lowering(data->jsgraph()); | 441 SimplifiedLowering lowering(data->jsgraph()); |
442 lowering.LowerAllNodes(); | 442 lowering.LowerAllNodes(); |
443 ValueNumberingReducer vn_reducer(temp_zone); | 443 ValueNumberingReducer vn_reducer(temp_zone); |
444 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); | 444 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); |
| 445 MachineOperatorReducer machine_reducer(data->jsgraph()); |
445 GraphReducer graph_reducer(data->graph(), temp_zone); | 446 GraphReducer graph_reducer(data->graph(), temp_zone); |
446 graph_reducer.AddReducer(&vn_reducer); | 447 graph_reducer.AddReducer(&vn_reducer); |
447 graph_reducer.AddReducer(&simple_reducer); | 448 graph_reducer.AddReducer(&simple_reducer); |
| 449 graph_reducer.AddReducer(&machine_reducer); |
448 graph_reducer.ReduceGraph(); | 450 graph_reducer.ReduceGraph(); |
449 } | 451 } |
450 }; | 452 }; |
451 | 453 |
452 | 454 |
453 struct ChangeLoweringPhase { | 455 struct ChangeLoweringPhase { |
454 static const char* phase_name() { return "change lowering"; } | 456 static const char* phase_name() { return "change lowering"; } |
455 | 457 |
456 void Run(PipelineData* data, Zone* temp_zone) { | 458 void Run(PipelineData* data, Zone* temp_zone) { |
457 SourcePositionTable::Scope pos(data->source_positions(), | 459 SourcePositionTable::Scope pos(data->source_positions(), |
458 SourcePosition::Unknown()); | 460 SourcePosition::Unknown()); |
459 Linkage linkage(data->graph_zone(), data->info()); | 461 Linkage linkage(data->graph_zone(), data->info()); |
460 ValueNumberingReducer vn_reducer(temp_zone); | 462 ValueNumberingReducer vn_reducer(temp_zone); |
461 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); | 463 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); |
462 ChangeLowering lowering(data->jsgraph(), &linkage); | 464 ChangeLowering lowering(data->jsgraph(), &linkage); |
463 MachineOperatorReducer mach_reducer(data->jsgraph()); | 465 MachineOperatorReducer machine_reducer(data->jsgraph()); |
464 GraphReducer graph_reducer(data->graph(), temp_zone); | 466 GraphReducer graph_reducer(data->graph(), temp_zone); |
465 // TODO(titzer): Figure out if we should run all reducers at once here. | |
466 graph_reducer.AddReducer(&vn_reducer); | 467 graph_reducer.AddReducer(&vn_reducer); |
467 graph_reducer.AddReducer(&simple_reducer); | 468 graph_reducer.AddReducer(&simple_reducer); |
468 graph_reducer.AddReducer(&lowering); | 469 graph_reducer.AddReducer(&lowering); |
469 graph_reducer.AddReducer(&mach_reducer); | 470 graph_reducer.AddReducer(&machine_reducer); |
470 graph_reducer.ReduceGraph(); | 471 graph_reducer.ReduceGraph(); |
471 } | 472 } |
472 }; | 473 }; |
473 | 474 |
474 | 475 |
475 struct ControlReductionPhase { | 476 struct ControlReductionPhase { |
476 void Run(PipelineData* data, Zone* temp_zone) { | 477 void Run(PipelineData* data, Zone* temp_zone) { |
477 SourcePositionTable::Scope pos(data->source_positions(), | 478 SourcePositionTable::Scope pos(data->source_positions(), |
478 SourcePosition::Unknown()); | 479 SourcePosition::Unknown()); |
479 ControlReducer::ReduceGraph(temp_zone, data->jsgraph(), data->common()); | 480 ControlReducer::ReduceGraph(temp_zone, data->jsgraph(), data->common()); |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 } | 1078 } |
1078 | 1079 |
1079 | 1080 |
1080 void Pipeline::TearDown() { | 1081 void Pipeline::TearDown() { |
1081 InstructionOperand::TearDownCaches(); | 1082 InstructionOperand::TearDownCaches(); |
1082 } | 1083 } |
1083 | 1084 |
1084 } // namespace compiler | 1085 } // namespace compiler |
1085 } // namespace internal | 1086 } // namespace internal |
1086 } // namespace v8 | 1087 } // namespace v8 |
OLD | NEW |