| 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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 | 552 |
| 553 struct ReuseSpillSlotsPhase { | 553 struct ReuseSpillSlotsPhase { |
| 554 static const char* phase_name() { return "reuse spill slots"; } | 554 static const char* phase_name() { return "reuse spill slots"; } |
| 555 | 555 |
| 556 void Run(PipelineData* data, Zone* temp_zone) { | 556 void Run(PipelineData* data, Zone* temp_zone) { |
| 557 data->register_allocator()->ReuseSpillSlots(); | 557 data->register_allocator()->ReuseSpillSlots(); |
| 558 } | 558 } |
| 559 }; | 559 }; |
| 560 | 560 |
| 561 | 561 |
| 562 struct CommitAssignmentPhase { |
| 563 static const char* phase_name() { return "commit assignment"; } |
| 564 |
| 565 void Run(PipelineData* data, Zone* temp_zone) { |
| 566 data->register_allocator()->CommitAssignment(); |
| 567 } |
| 568 }; |
| 569 |
| 570 |
| 562 struct PopulatePointerMapsPhase { | 571 struct PopulatePointerMapsPhase { |
| 563 static const char* phase_name() { return "populate pointer maps"; } | 572 static const char* phase_name() { return "populate pointer maps"; } |
| 564 | 573 |
| 565 void Run(PipelineData* data, Zone* temp_zone) { | 574 void Run(PipelineData* data, Zone* temp_zone) { |
| 566 data->register_allocator()->PopulatePointerMaps(); | 575 data->register_allocator()->PopulatePointerMaps(); |
| 567 } | 576 } |
| 568 }; | 577 }; |
| 569 | 578 |
| 570 | 579 |
| 571 struct ConnectRangesPhase { | 580 struct ConnectRangesPhase { |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 | 992 |
| 984 Run<MeetRegisterConstraintsPhase>(); | 993 Run<MeetRegisterConstraintsPhase>(); |
| 985 Run<ResolvePhisPhase>(); | 994 Run<ResolvePhisPhase>(); |
| 986 Run<BuildLiveRangesPhase>(); | 995 Run<BuildLiveRangesPhase>(); |
| 987 if (FLAG_trace_turbo_graph) { | 996 if (FLAG_trace_turbo_graph) { |
| 988 OFStream os(stdout); | 997 OFStream os(stdout); |
| 989 PrintableInstructionSequence printable = {config, data->sequence()}; | 998 PrintableInstructionSequence printable = {config, data->sequence()}; |
| 990 os << "----- Instruction sequence before register allocation -----\n" | 999 os << "----- Instruction sequence before register allocation -----\n" |
| 991 << printable; | 1000 << printable; |
| 992 } | 1001 } |
| 993 DCHECK(!data->register_allocator()->ExistsUseWithoutDefinition()); | 1002 if (verifier != nullptr) { |
| 1003 CHECK(!data->register_allocator()->ExistsUseWithoutDefinition()); |
| 1004 } |
| 994 Run<AllocateGeneralRegistersPhase>(); | 1005 Run<AllocateGeneralRegistersPhase>(); |
| 995 if (!data->register_allocator()->AllocationOk()) { | 1006 if (!data->register_allocator()->AllocationOk()) { |
| 996 data->set_compilation_failed(); | 1007 data->set_compilation_failed(); |
| 997 return; | 1008 return; |
| 998 } | 1009 } |
| 999 Run<AllocateDoubleRegistersPhase>(); | 1010 Run<AllocateDoubleRegistersPhase>(); |
| 1000 if (!data->register_allocator()->AllocationOk()) { | 1011 if (!data->register_allocator()->AllocationOk()) { |
| 1001 data->set_compilation_failed(); | 1012 data->set_compilation_failed(); |
| 1002 return; | 1013 return; |
| 1003 } | 1014 } |
| 1004 if (FLAG_turbo_reuse_spill_slots) { | 1015 if (FLAG_turbo_reuse_spill_slots) { |
| 1005 Run<ReuseSpillSlotsPhase>(); | 1016 Run<ReuseSpillSlotsPhase>(); |
| 1006 } | 1017 } |
| 1018 Run<CommitAssignmentPhase>(); |
| 1007 Run<PopulatePointerMapsPhase>(); | 1019 Run<PopulatePointerMapsPhase>(); |
| 1008 Run<ConnectRangesPhase>(); | 1020 Run<ConnectRangesPhase>(); |
| 1009 Run<ResolveControlFlowPhase>(); | 1021 Run<ResolveControlFlowPhase>(); |
| 1010 Run<OptimizeMovesPhase>(); | 1022 Run<OptimizeMovesPhase>(); |
| 1011 | 1023 |
| 1012 if (FLAG_trace_turbo_graph) { | 1024 if (FLAG_trace_turbo_graph) { |
| 1013 OFStream os(stdout); | 1025 OFStream os(stdout); |
| 1014 PrintableInstructionSequence printable = {config, data->sequence()}; | 1026 PrintableInstructionSequence printable = {config, data->sequence()}; |
| 1015 os << "----- Instruction sequence after register allocation -----\n" | 1027 os << "----- Instruction sequence after register allocation -----\n" |
| 1016 << printable; | 1028 << printable; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1033 } | 1045 } |
| 1034 | 1046 |
| 1035 | 1047 |
| 1036 void Pipeline::TearDown() { | 1048 void Pipeline::TearDown() { |
| 1037 InstructionOperand::TearDownCaches(); | 1049 InstructionOperand::TearDownCaches(); |
| 1038 } | 1050 } |
| 1039 | 1051 |
| 1040 } // namespace compiler | 1052 } // namespace compiler |
| 1041 } // namespace internal | 1053 } // namespace internal |
| 1042 } // namespace v8 | 1054 } // namespace v8 |
| OLD | NEW |