Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: src/compiler/greedy-allocator.h

Issue 1242123006: [turbofan] Deferred block spilling heuristic - first step. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/greedy-allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef V8_GREEDY_ALLOCATOR_H_ 5 #ifndef V8_GREEDY_ALLOCATOR_H_
6 #define V8_GREEDY_ALLOCATOR_H_ 6 #define V8_GREEDY_ALLOCATOR_H_
7 7
8 #include "src/compiler/coalesced-live-ranges.h" 8 #include "src/compiler/coalesced-live-ranges.h"
9 #include "src/compiler/register-allocator.h" 9 #include "src/compiler/register-allocator.h"
10 #include "src/zone-containers.h" 10 #include "src/zone-containers.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 namespace compiler { 14 namespace compiler {
15 15
16 16
17 // The object of allocation scheduling. At minimum, this is a LiveRange, but 17 // The object of allocation scheduling. At minimum, this is a LiveRange, but
18 // we may extend this to groups of LiveRanges. It has to be comparable. 18 // we may extend this to groups of LiveRanges. It has to be comparable.
19 class AllocationCandidate { 19 class AllocationCandidate {
20 public: 20 public:
21 explicit AllocationCandidate(LiveRange* range) : range_(range) {} 21 explicit AllocationCandidate(LiveRange* range) : range_(range) {}
22 22
23 // Strict ordering operators 23 // Strict ordering operators
24 bool operator<(const AllocationCandidate& other) const { 24 bool operator<(const AllocationCandidate& other) const {
25 return range_->GetSize() < other.range_->GetSize(); 25 DCHECK(range_->IsSizeValid());
26 DCHECK(other.range_->IsSizeValid());
27 return range_->size() < other.range_->size();
26 } 28 }
27 29
28 bool operator>(const AllocationCandidate& other) const { 30 bool operator>(const AllocationCandidate& other) const {
29 return range_->GetSize() > other.range_->GetSize(); 31 DCHECK(range_->IsSizeValid());
32 DCHECK(other.range_->IsSizeValid());
33 return range_->size() > other.range_->size();
30 } 34 }
31 35
32 LiveRange* live_range() const { return range_; } 36 LiveRange* live_range() const { return range_; }
33 37
34 private: 38 private:
35 LiveRange* range_; 39 LiveRange* range_;
36 }; 40 };
37 41
38 42
39 // Schedule processing (allocating) of AllocationCandidates. 43 // Schedule processing (allocating) of AllocationCandidates.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 136
133 Zone* local_zone_; 137 Zone* local_zone_;
134 ZoneVector<CoalescedLiveRanges*> allocations_; 138 ZoneVector<CoalescedLiveRanges*> allocations_;
135 AllocationScheduler scheduler_; 139 AllocationScheduler scheduler_;
136 DISALLOW_COPY_AND_ASSIGN(GreedyAllocator); 140 DISALLOW_COPY_AND_ASSIGN(GreedyAllocator);
137 }; 141 };
138 } // namespace compiler 142 } // namespace compiler
139 } // namespace internal 143 } // namespace internal
140 } // namespace v8 144 } // namespace v8
141 #endif // V8_GREEDY_ALLOCATOR_H_ 145 #endif // V8_GREEDY_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/greedy-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698