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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 AddReducer(data, &graph_reducer, &vn_reducer); | 586 AddReducer(data, &graph_reducer, &vn_reducer); |
587 AddReducer(data, &graph_reducer, &simple_reducer); | 587 AddReducer(data, &graph_reducer, &simple_reducer); |
588 AddReducer(data, &graph_reducer, &lowering); | 588 AddReducer(data, &graph_reducer, &lowering); |
589 AddReducer(data, &graph_reducer, &machine_reducer); | 589 AddReducer(data, &graph_reducer, &machine_reducer); |
590 AddReducer(data, &graph_reducer, &common_reducer); | 590 AddReducer(data, &graph_reducer, &common_reducer); |
591 graph_reducer.ReduceGraph(); | 591 graph_reducer.ReduceGraph(); |
592 } | 592 } |
593 }; | 593 }; |
594 | 594 |
595 | 595 |
596 struct ControlReductionPhase { | 596 struct EarlyControlReductionPhase { |
| 597 static const char* phase_name() { return "early control reduction"; } |
597 void Run(PipelineData* data, Zone* temp_zone) { | 598 void Run(PipelineData* data, Zone* temp_zone) { |
598 SourcePositionTable::Scope pos(data->source_positions(), | 599 SourcePositionTable::Scope pos(data->source_positions(), |
599 SourcePosition::Unknown()); | 600 SourcePosition::Unknown()); |
600 ControlReducer::ReduceGraph(temp_zone, data->jsgraph(), data->common()); | 601 ControlReducer::ReduceGraph(temp_zone, data->jsgraph(), data->common(), 1); |
601 } | 602 } |
602 }; | 603 }; |
603 | 604 |
604 | 605 |
605 struct EarlyControlReductionPhase : ControlReductionPhase { | 606 struct LateControlReductionPhase { |
606 static const char* phase_name() { return "early control reduction"; } | 607 static const char* phase_name() { return "late control reduction"; } |
| 608 void Run(PipelineData* data, Zone* temp_zone) { |
| 609 SourcePositionTable::Scope pos(data->source_positions(), |
| 610 SourcePosition::Unknown()); |
| 611 ControlReducer::ReduceGraph(temp_zone, data->jsgraph(), data->common(), 0); |
| 612 } |
607 }; | 613 }; |
608 | 614 |
609 | 615 |
610 struct LateControlReductionPhase : ControlReductionPhase { | |
611 static const char* phase_name() { return "late control reduction"; } | |
612 }; | |
613 | |
614 | |
615 struct StressLoopPeelingPhase { | 616 struct StressLoopPeelingPhase { |
616 static const char* phase_name() { return "stress loop peeling"; } | 617 static const char* phase_name() { return "stress loop peeling"; } |
617 | 618 |
618 void Run(PipelineData* data, Zone* temp_zone) { | 619 void Run(PipelineData* data, Zone* temp_zone) { |
619 SourcePositionTable::Scope pos(data->source_positions(), | 620 SourcePositionTable::Scope pos(data->source_positions(), |
620 SourcePosition::Unknown()); | 621 SourcePosition::Unknown()); |
621 // Peel the first outer loop for testing. | 622 // Peel the first outer loop for testing. |
622 // TODO(titzer): peel all loops? the N'th loop? Innermost loops? | 623 // TODO(titzer): peel all loops? the N'th loop? Innermost loops? |
623 LoopTree* loop_tree = LoopFinder::BuildLoopTree(data->graph(), temp_zone); | 624 LoopTree* loop_tree = LoopFinder::BuildLoopTree(data->graph(), temp_zone); |
624 if (loop_tree != NULL && loop_tree->outer_loops().size() > 0) { | 625 if (loop_tree != NULL && loop_tree->outer_loops().size() > 0) { |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 | 1237 |
1237 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { | 1238 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { |
1238 TurboCfgFile tcf(data->isolate()); | 1239 TurboCfgFile tcf(data->isolate()); |
1239 tcf << AsC1VAllocator("CodeGen", data->register_allocator()); | 1240 tcf << AsC1VAllocator("CodeGen", data->register_allocator()); |
1240 } | 1241 } |
1241 } | 1242 } |
1242 | 1243 |
1243 } // namespace compiler | 1244 } // namespace compiler |
1244 } // namespace internal | 1245 } // namespace internal |
1245 } // namespace v8 | 1246 } // namespace v8 |
OLD | NEW |