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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/compiler/linkage.h" | 6 #include "src/compiler/linkage.h" |
7 #include "src/compiler/register-allocator.h" | 7 #include "src/compiler/register-allocator.h" |
8 #include "src/string-stream.h" | 8 #include "src/string-stream.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 2414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2425 DCHECK(RegisterConfiguration::kMaxDoubleRegisters >= | 2425 DCHECK(RegisterConfiguration::kMaxDoubleRegisters >= |
2426 this->data()->config()->num_general_registers()); | 2426 this->data()->config()->num_general_registers()); |
2427 } | 2427 } |
2428 | 2428 |
2429 | 2429 |
2430 void LinearScanAllocator::AllocateRegisters() { | 2430 void LinearScanAllocator::AllocateRegisters() { |
2431 DCHECK(unhandled_live_ranges().empty()); | 2431 DCHECK(unhandled_live_ranges().empty()); |
2432 DCHECK(active_live_ranges().empty()); | 2432 DCHECK(active_live_ranges().empty()); |
2433 DCHECK(inactive_live_ranges().empty()); | 2433 DCHECK(inactive_live_ranges().empty()); |
2434 | 2434 |
2435 SplitAndSpillRangesDefinedByMemoryOperand(false); | 2435 SplitAndSpillRangesDefinedByMemoryOperand(code()->VirtualRegisterCount() <= |
2436 num_allocatable_registers()); | |
Jarin
2015/11/24 10:17:36
This seems to be a hacky approximation in both dir
| |
2436 | 2437 |
2437 for (TopLevelLiveRange* range : data()->live_ranges()) { | 2438 for (TopLevelLiveRange* range : data()->live_ranges()) { |
2438 if (!CanProcessRange(range)) continue; | 2439 if (!CanProcessRange(range)) continue; |
2439 for (LiveRange* to_add = range; to_add != nullptr; | 2440 for (LiveRange* to_add = range; to_add != nullptr; |
2440 to_add = to_add->next()) { | 2441 to_add = to_add->next()) { |
2441 if (!to_add->spilled()) { | 2442 if (!to_add->spilled()) { |
2442 AddToUnhandledUnsorted(to_add); | 2443 AddToUnhandledUnsorted(to_add); |
2443 } | 2444 } |
2444 } | 2445 } |
2445 } | 2446 } |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3465 auto eliminate = moves->PrepareInsertAfter(move); | 3466 auto eliminate = moves->PrepareInsertAfter(move); |
3466 to_insert.push_back(move); | 3467 to_insert.push_back(move); |
3467 if (eliminate != nullptr) to_eliminate.push_back(eliminate); | 3468 if (eliminate != nullptr) to_eliminate.push_back(eliminate); |
3468 } | 3469 } |
3469 } | 3470 } |
3470 | 3471 |
3471 | 3472 |
3472 } // namespace compiler | 3473 } // namespace compiler |
3473 } // namespace internal | 3474 } // namespace internal |
3474 } // namespace v8 | 3475 } // namespace v8 |
OLD | NEW |