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/adapters.h" | 10 #include "src/base/adapters.h" |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 struct AllocateGeneralRegistersPhase { | 981 struct AllocateGeneralRegistersPhase { |
982 static const char* phase_name() { return "allocate general registers"; } | 982 static const char* phase_name() { return "allocate general registers"; } |
983 | 983 |
984 void Run(PipelineData* data, Zone* temp_zone) { | 984 void Run(PipelineData* data, Zone* temp_zone) { |
985 RegAllocator allocator(data->register_allocation_data(), GENERAL_REGISTERS, | 985 RegAllocator allocator(data->register_allocation_data(), GENERAL_REGISTERS, |
986 temp_zone); | 986 temp_zone); |
987 allocator.AllocateRegisters(); | 987 allocator.AllocateRegisters(); |
988 } | 988 } |
989 }; | 989 }; |
990 | 990 |
991 | |
992 template <typename RegAllocator> | 991 template <typename RegAllocator> |
993 struct AllocateDoubleRegistersPhase { | 992 struct AllocateFPRegistersPhase { |
994 static const char* phase_name() { return "allocate double registers"; } | 993 static const char* phase_name() { |
| 994 return "allocate floating point registers"; |
| 995 } |
995 | 996 |
996 void Run(PipelineData* data, Zone* temp_zone) { | 997 void Run(PipelineData* data, Zone* temp_zone) { |
997 RegAllocator allocator(data->register_allocation_data(), DOUBLE_REGISTERS, | 998 RegAllocator allocator(data->register_allocation_data(), FP_REGISTERS, |
998 temp_zone); | 999 temp_zone); |
999 allocator.AllocateRegisters(); | 1000 allocator.AllocateRegisters(); |
1000 } | 1001 } |
1001 }; | 1002 }; |
1002 | 1003 |
1003 | 1004 |
1004 struct MergeSplintersPhase { | 1005 struct MergeSplintersPhase { |
1005 static const char* phase_name() { return "merge splintered ranges"; } | 1006 static const char* phase_name() { return "merge splintered ranges"; } |
1006 void Run(PipelineData* pipeline_data, Zone* temp_zone) { | 1007 void Run(PipelineData* pipeline_data, Zone* temp_zone) { |
1007 RegisterAllocationData* data = pipeline_data->register_allocation_data(); | 1008 RegisterAllocationData* data = pipeline_data->register_allocation_data(); |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 CHECK(data->register_allocation_data() | 1544 CHECK(data->register_allocation_data() |
1544 ->RangesDefinedInDeferredStayInDeferred()); | 1545 ->RangesDefinedInDeferredStayInDeferred()); |
1545 } | 1546 } |
1546 | 1547 |
1547 if (FLAG_turbo_preprocess_ranges) { | 1548 if (FLAG_turbo_preprocess_ranges) { |
1548 Run<SplinterLiveRangesPhase>(); | 1549 Run<SplinterLiveRangesPhase>(); |
1549 } | 1550 } |
1550 | 1551 |
1551 if (FLAG_turbo_greedy_regalloc) { | 1552 if (FLAG_turbo_greedy_regalloc) { |
1552 Run<AllocateGeneralRegistersPhase<GreedyAllocator>>(); | 1553 Run<AllocateGeneralRegistersPhase<GreedyAllocator>>(); |
1553 Run<AllocateDoubleRegistersPhase<GreedyAllocator>>(); | 1554 Run<AllocateFPRegistersPhase<GreedyAllocator>>(); |
1554 } else { | 1555 } else { |
1555 Run<AllocateGeneralRegistersPhase<LinearScanAllocator>>(); | 1556 Run<AllocateGeneralRegistersPhase<LinearScanAllocator>>(); |
1556 Run<AllocateDoubleRegistersPhase<LinearScanAllocator>>(); | 1557 Run<AllocateFPRegistersPhase<LinearScanAllocator>>(); |
1557 } | 1558 } |
1558 | 1559 |
1559 if (FLAG_turbo_preprocess_ranges) { | 1560 if (FLAG_turbo_preprocess_ranges) { |
1560 Run<MergeSplintersPhase>(); | 1561 Run<MergeSplintersPhase>(); |
1561 } | 1562 } |
1562 | 1563 |
1563 Run<AssignSpillSlotsPhase>(); | 1564 Run<AssignSpillSlotsPhase>(); |
1564 | 1565 |
1565 Run<CommitAssignmentPhase>(); | 1566 Run<CommitAssignmentPhase>(); |
1566 Run<PopulateReferenceMapsPhase>(); | 1567 Run<PopulateReferenceMapsPhase>(); |
(...skipping 24 matching lines...) Expand all Loading... |
1591 } | 1592 } |
1592 | 1593 |
1593 data->DeleteRegisterAllocationZone(); | 1594 data->DeleteRegisterAllocationZone(); |
1594 } | 1595 } |
1595 | 1596 |
1596 Isolate* Pipeline::isolate() const { return info()->isolate(); } | 1597 Isolate* Pipeline::isolate() const { return info()->isolate(); } |
1597 | 1598 |
1598 } // namespace compiler | 1599 } // namespace compiler |
1599 } // namespace internal | 1600 } // namespace internal |
1600 } // namespace v8 | 1601 } // namespace v8 |
OLD | NEW |