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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 | 499 |
500 struct MeetRegisterConstraintsPhase { | 500 struct MeetRegisterConstraintsPhase { |
501 static const char* phase_name() { return "meet register constraints"; } | 501 static const char* phase_name() { return "meet register constraints"; } |
502 | 502 |
503 void Run(PipelineData* data, Zone* temp_zone) { | 503 void Run(PipelineData* data, Zone* temp_zone) { |
504 data->register_allocator()->MeetRegisterConstraints(); | 504 data->register_allocator()->MeetRegisterConstraints(); |
505 } | 505 } |
506 }; | 506 }; |
507 | 507 |
508 | 508 |
| 509 struct ResolvePhisPhase { |
| 510 static const char* phase_name() { return "resolve phis"; } |
| 511 |
| 512 void Run(PipelineData* data, Zone* temp_zone) { |
| 513 data->register_allocator()->ResolvePhis(); |
| 514 } |
| 515 }; |
| 516 |
| 517 |
509 struct BuildLiveRangesPhase { | 518 struct BuildLiveRangesPhase { |
510 static const char* phase_name() { return "build live ranges"; } | 519 static const char* phase_name() { return "build live ranges"; } |
511 | 520 |
512 void Run(PipelineData* data, Zone* temp_zone) { | 521 void Run(PipelineData* data, Zone* temp_zone) { |
513 data->register_allocator()->BuildLiveRanges(); | 522 data->register_allocator()->BuildLiveRanges(); |
514 } | 523 } |
515 }; | 524 }; |
516 | 525 |
517 | 526 |
518 struct AllocateGeneralRegistersPhase { | 527 struct AllocateGeneralRegistersPhase { |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 SmartArrayPointer<char> debug_name; | 928 SmartArrayPointer<char> debug_name; |
920 #ifdef DEBUG | 929 #ifdef DEBUG |
921 debug_name = GetDebugName(data->info()); | 930 debug_name = GetDebugName(data->info()); |
922 #endif | 931 #endif |
923 | 932 |
924 ZonePool::Scope zone_scope(data->zone_pool()); | 933 ZonePool::Scope zone_scope(data->zone_pool()); |
925 data->InitializeRegisterAllocator(zone_scope.zone(), config, | 934 data->InitializeRegisterAllocator(zone_scope.zone(), config, |
926 debug_name.get()); | 935 debug_name.get()); |
927 | 936 |
928 Run<MeetRegisterConstraintsPhase>(); | 937 Run<MeetRegisterConstraintsPhase>(); |
| 938 Run<ResolvePhisPhase>(); |
929 Run<BuildLiveRangesPhase>(); | 939 Run<BuildLiveRangesPhase>(); |
930 if (FLAG_trace_turbo) { | 940 if (FLAG_trace_turbo) { |
931 OFStream os(stdout); | 941 OFStream os(stdout); |
932 PrintableInstructionSequence printable = {config, data->sequence()}; | 942 PrintableInstructionSequence printable = {config, data->sequence()}; |
933 os << "----- Instruction sequence before register allocation -----\n" | 943 os << "----- Instruction sequence before register allocation -----\n" |
934 << printable; | 944 << printable; |
935 } | 945 } |
936 DCHECK(!data->register_allocator()->ExistsUseWithoutDefinition()); | 946 DCHECK(!data->register_allocator()->ExistsUseWithoutDefinition()); |
937 Run<AllocateGeneralRegistersPhase>(); | 947 Run<AllocateGeneralRegistersPhase>(); |
938 if (!data->register_allocator()->AllocationOk()) { | 948 if (!data->register_allocator()->AllocationOk()) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 } | 985 } |
976 | 986 |
977 | 987 |
978 void Pipeline::TearDown() { | 988 void Pipeline::TearDown() { |
979 InstructionOperand::TearDownCaches(); | 989 InstructionOperand::TearDownCaches(); |
980 } | 990 } |
981 | 991 |
982 } // namespace compiler | 992 } // namespace compiler |
983 } // namespace internal | 993 } // namespace internal |
984 } // namespace v8 | 994 } // namespace v8 |
OLD | NEW |