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 | |
518 struct BuildLiveRangesPhase { | 509 struct BuildLiveRangesPhase { |
519 static const char* phase_name() { return "build live ranges"; } | 510 static const char* phase_name() { return "build live ranges"; } |
520 | 511 |
521 void Run(PipelineData* data, Zone* temp_zone) { | 512 void Run(PipelineData* data, Zone* temp_zone) { |
522 data->register_allocator()->BuildLiveRanges(); | 513 data->register_allocator()->BuildLiveRanges(); |
523 } | 514 } |
524 }; | 515 }; |
525 | 516 |
526 | 517 |
527 struct AllocateGeneralRegistersPhase { | 518 struct AllocateGeneralRegistersPhase { |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 SmartArrayPointer<char> debug_name; | 910 SmartArrayPointer<char> debug_name; |
920 #ifdef DEBUG | 911 #ifdef DEBUG |
921 debug_name = GetDebugName(data->info()); | 912 debug_name = GetDebugName(data->info()); |
922 #endif | 913 #endif |
923 | 914 |
924 ZonePool::Scope zone_scope(data->zone_pool()); | 915 ZonePool::Scope zone_scope(data->zone_pool()); |
925 data->InitializeRegisterAllocator(zone_scope.zone(), config, | 916 data->InitializeRegisterAllocator(zone_scope.zone(), config, |
926 debug_name.get()); | 917 debug_name.get()); |
927 | 918 |
928 Run<MeetRegisterConstraintsPhase>(); | 919 Run<MeetRegisterConstraintsPhase>(); |
929 Run<ResolvePhisPhase>(); | |
930 Run<BuildLiveRangesPhase>(); | 920 Run<BuildLiveRangesPhase>(); |
931 if (FLAG_trace_turbo) { | 921 if (FLAG_trace_turbo) { |
932 OFStream os(stdout); | 922 OFStream os(stdout); |
933 PrintableInstructionSequence printable = {config, data->sequence()}; | 923 PrintableInstructionSequence printable = {config, data->sequence()}; |
934 os << "----- Instruction sequence before register allocation -----\n" | 924 os << "----- Instruction sequence before register allocation -----\n" |
935 << printable; | 925 << printable; |
936 } | 926 } |
937 DCHECK(!data->register_allocator()->ExistsUseWithoutDefinition()); | 927 DCHECK(!data->register_allocator()->ExistsUseWithoutDefinition()); |
938 Run<AllocateGeneralRegistersPhase>(); | 928 Run<AllocateGeneralRegistersPhase>(); |
939 if (!data->register_allocator()->AllocationOk()) { | 929 if (!data->register_allocator()->AllocationOk()) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 } | 963 } |
974 | 964 |
975 | 965 |
976 void Pipeline::TearDown() { | 966 void Pipeline::TearDown() { |
977 InstructionOperand::TearDownCaches(); | 967 InstructionOperand::TearDownCaches(); |
978 } | 968 } |
979 | 969 |
980 } // namespace compiler | 970 } // namespace compiler |
981 } // namespace internal | 971 } // namespace internal |
982 } // namespace v8 | 972 } // namespace v8 |
OLD | NEW |