OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/greedy-allocator.h" | 5 #include "src/compiler/greedy-allocator.h" |
6 #include "src/compiler/register-allocator.h" | 6 #include "src/compiler/register-allocator.h" |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 namespace compiler { | 10 namespace compiler { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 } | 361 } |
362 | 362 |
363 | 363 |
364 void GreedyAllocator::AllocateRegisters() { | 364 void GreedyAllocator::AllocateRegisters() { |
365 CHECK(scheduler().empty()); | 365 CHECK(scheduler().empty()); |
366 CHECK(allocations_.empty()); | 366 CHECK(allocations_.empty()); |
367 | 367 |
368 TRACE("Begin allocating function %s with the Greedy Allocator\n", | 368 TRACE("Begin allocating function %s with the Greedy Allocator\n", |
369 data()->debug_name()); | 369 data()->debug_name()); |
370 | 370 |
371 SplitAndSpillRangesDefinedByMemoryOperand(); | 371 SplitAndSpillRangesDefinedByMemoryOperand(true); |
372 GroupLiveRanges(); | 372 GroupLiveRanges(); |
373 ScheduleAllocationCandidates(); | 373 ScheduleAllocationCandidates(); |
374 PreallocateFixedRanges(); | 374 PreallocateFixedRanges(); |
375 while (!scheduler().empty()) { | 375 while (!scheduler().empty()) { |
376 AllocationCandidate candidate = scheduler().GetNext(); | 376 AllocationCandidate candidate = scheduler().GetNext(); |
377 TryAllocateCandidate(candidate); | 377 TryAllocateCandidate(candidate); |
378 } | 378 } |
379 | 379 |
380 for (size_t i = 0; i < allocations_.size(); ++i) { | 380 for (size_t i = 0; i < allocations_.size(); ++i) { |
381 if (!allocations_[i]->empty()) { | 381 if (!allocations_[i]->empty()) { |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 | 620 |
621 | 621 |
622 bool GreedyAllocator::IsProgressPossible(const LiveRange* range) { | 622 bool GreedyAllocator::IsProgressPossible(const LiveRange* range) { |
623 return range->CanBeSpilled(range->Start()) || | 623 return range->CanBeSpilled(range->Start()) || |
624 GetLastResortSplitPosition(range).IsValid(); | 624 GetLastResortSplitPosition(range).IsValid(); |
625 } | 625 } |
626 | 626 |
627 } // namespace compiler | 627 } // namespace compiler |
628 } // namespace internal | 628 } // namespace internal |
629 } // namespace v8 | 629 } // namespace v8 |
OLD | NEW |